Re: [PATCH 5/6] mm: honor PF_MEMALLOC_NOMOVABLE for all allocations

From: John Hubbard
Date: Thu Dec 03 2020 - 11:52:26 EST


On 12/3/20 7:06 AM, Pavel Tatashin wrote:
...
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 611799c72da5..7a6d86d0bc5f 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3766,20 +3766,25 @@ alloc_flags_nofragment(struct zone *zone, gfp_t gfp_mask)
return alloc_flags;
}

-static inline unsigned int current_alloc_flags(gfp_t gfp_mask,
- unsigned int alloc_flags)
+static inline unsigned int cma_alloc_flags(gfp_t gfp_mask,
+ unsigned int alloc_flags)

Actually, maybe the original name should be left intact. This handles current alloc
flags, which right now happen to only cover CMA flags, so the original name seems
accurate, right?

The reason I re-named it is because we do not access current context
anymore, only use gfp_mask to get cma flag.
- unsigned int pflags = current->flags;

So, keeping "current" in the function name makes its intent misleading.


OK, I see. That sounds OK then.


thanks,
--
John Hubbard
NVIDIA