On Wed, 07 Sep 2016 08:41:26 +0800 Li Zhong <zhong@xxxxxxxxxxxxxxxxxx> wrote: > 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; > + } > + Wouldn't it be better to do if (WARN_ON(ac->nodemask && nodes_empty(*ac->nodemask)) { ... so we can identify the misbehaving call site? -- 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>