From 999f2ea7d8d8e268f1fd744df270366bdd4a4fb6 Mon Sep 17 00:00:00 2001 From: Liam Mark Date: Tue, 18 Sep 2018 17:00:13 -0700 Subject: [PATCH] pagemap.h: Allow readahead Movable allocations from CMA region There are a lot of readahead Movable allocations. These allocations don't appear to get 'pinned' so allow them to be satisfied from the CMA region in order to better utilize CMA memory. Change-Id: I87387a748e67a6963b9a526b729e6e273c1cc519 Signed-off-by: Liam Mark --- include/linux/pagemap.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 37a4d9e32cd3..60136487b584 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -223,7 +223,13 @@ static inline struct page *page_cache_alloc(struct address_space *x) static inline gfp_t readahead_gfp_mask(struct address_space *x) { - return mapping_gfp_mask(x) | __GFP_NORETRY | __GFP_NOWARN; + gfp_t gfp_mask = mapping_gfp_mask(x) | + __GFP_NORETRY | __GFP_NOWARN; + + if (gfp_mask & __GFP_MOVABLE) + gfp_mask |= __GFP_CMA; + + return gfp_mask; } typedef int filler_t(void *, struct page *);