ANDROID: vendor_hooks: Add hooks for __alloc_pages_direct_reclaim
Provide a vendor hook to allow drain_all_pages to be skipped during direct reclaim in some cases to avoid delays caused by it in cases when the benefits of draining pcp lists are known to be small. Bug: 220811627 Signed-off-by: Liujie Xie <xieliujie@oppo.com> Change-Id: I0805241f81e0a94afcf62c98e97cff125d4061e2
This commit is contained in:

committed by
Suren Baghdasaryan

parent
135406cecb
commit
ebbf267fc0
@@ -4505,6 +4505,7 @@ __alloc_pages_direct_reclaim(gfp_t gfp_mask, unsigned int order,
|
||||
struct page *page = NULL;
|
||||
unsigned long pflags;
|
||||
bool drained = false;
|
||||
bool skip_pcp_drain = false;
|
||||
|
||||
psi_memstall_enter(&pflags);
|
||||
*did_some_progress = __perform_reclaim(gfp_mask, order, ac);
|
||||
@@ -4521,7 +4522,10 @@ retry:
|
||||
*/
|
||||
if (!page && !drained) {
|
||||
unreserve_highatomic_pageblock(ac, false);
|
||||
drain_all_pages(NULL);
|
||||
trace_android_vh_drain_all_pages_bypass(gfp_mask, order,
|
||||
alloc_flags, ac->migratetype, *did_some_progress, &skip_pcp_drain);
|
||||
if (!skip_pcp_drain)
|
||||
drain_all_pages(NULL);
|
||||
drained = true;
|
||||
goto retry;
|
||||
}
|
||||
|
Reference in New Issue
Block a user