diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 5d123b399713631bcc5cc30498d4b3ab494bb4bf..dc8753bdd47eab9dcd2b0be28914e62513862663 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1151,6 +1151,17 @@ __alloc_pages(gfp_t gfp_mask, unsigned int order, if (page) goto got_pg; + /* + * 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 (NUMA_BUILD && (gfp_mask & GFP_THISNODE) == GFP_THISNODE) + goto nopage; + for (z = zonelist->zones; *z; z++) wakeup_kswapd(*z, order);