alloc_pages_preferred_node() variant, change the exact_node() variant to passSounds like that should be done as part of a cleanup after the 4.0 issues
__GFP_THISNODE, and audit and adjust all callers accordingly.
are addressed. alloc_pages_exact_node() does seem to suggest that we want
exactly that node, implying __GFP_THISNODE behavior already, so it would
be good to avoid having this come up again in the future.
Also, you pass __GFP_NOWARN but that should be covered by GFP_TRANSHUGEAh, good point, and it includes __GFP_NORETRY as well which means that
already. Of course, nothing guarantees that hugepage == true implies that gfp
== GFP_TRANSHUGE... but current in-tree callers conform to that.
this patch is busted. It won't try compaction or direct reclaim in the
page allocator slowpath because of this:
/*
* GFP_THISNODE (meaning __GFP_THISNODE, __GFP_NORETRY and
* __GFP_NOWARN set) should not cause reclaim since the subsystem
* (f.e. slab) using GFP_THISNODE may choose to trigger reclaim
* using a larger set of nodes after it has established that the
* allowed per node queues are empty and that nodes are
* over allocated.
*/
if (IS_ENABLED(CONFIG_NUMA) &&
(gfp_mask & GFP_THISNODE) == GFP_THISNODE)
goto nopage;
Hmm. It would be disappointing to have to pass the nodemask of the exact
node that we want to allocate from into the page allocator to avoid using
__GFP_THISNODE.
There's a sneaky way around it by just removing __GFP_NORETRY from
GFP_TRANSHUGE so the condition above fails and since the page allocator
won't retry for such a high-order allocation, but that probably just
papers over this stuff too much already. I think what we want to do is
cause the slab allocators to not use __GFP_WAIT if they want to avoid
reclaim.
This is probably going to be a much more invasive patch than originally
thought.