ANDROID: mm: Create vendor hooks to control ZONE_MOVABLE allocations

Create a vendor hook inside of gfp_zone() to modify which allocations
get to enter ZONE_MOVABLE, by zeroing out __GFP_HIGHMEM inside of the
trace hook based on certain conditions.

Separately, create separate trace hooks in the swap-in and readahead
paths to affect the behavior of the tracehook in gfp_zone().

Bug: 158645321
Change-Id: I4a4f0b724267ee120a1e5661f6da5d43d7ef6fc6
Signed-off-by: Chris Goldsworthy <cgoldswo@codeaurora.org>
This commit is contained in:
Chris Goldsworthy
2020-11-09 22:26:47 -08:00
parent 3d7ab504ec
commit 62e32cf8f3
7 changed files with 76 additions and 16 deletions

View File

@@ -23,6 +23,7 @@
#include <linux/blk-cgroup.h>
#include <linux/fadvise.h>
#include <linux/sched/mm.h>
#include <trace/hooks/mm.h>
#include "internal.h"
@@ -114,6 +115,15 @@ int read_cache_pages(struct address_space *mapping, struct list_head *pages,
EXPORT_SYMBOL(read_cache_pages);
gfp_t readahead_gfp_mask(struct address_space *x)
{
gfp_t mask = mapping_gfp_mask(x) | __GFP_NORETRY | __GFP_NOWARN;
trace_android_rvh_set_readahead_gfp_mask(&mask);
return mask;
}
EXPORT_SYMBOL_GPL(readahead_gfp_mask);
static void read_pages(struct readahead_control *rac, struct list_head *pages,
bool skip_page)
{