Warn about allocating with an empty nodemask, it would be easier to understand than oom messages. The check is added in the slow path. Suggested-by: Vlastimil Babka <vbabka@xxxxxxx> Signed-off-by: Li Zhong <zhong@xxxxxxxxxxxxxxxxxx> --- mm/page_alloc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index a2214c6..d624ff3 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3448,6 +3448,12 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, if (page) goto got_pg; + if (ac->nodemask && nodes_empty(*ac->nodemask)) { + pr_warn("nodemask is empty\n"); + gfp_mask &= ~__GFP_NOWARN; + goto nopage; + } + /* * For costly allocations, try direct compaction first, as it's likely * that we have enough base pages and don't need to reclaim. Don't try -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>