diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2aaafe82f513dcd9820c5adb08bfb6a18d42615b..36a168e383b5a2041b8dddb83d0eff8caa6c8381 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2171,12 +2171,25 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, nopage: if (!(gfp_mask & __GFP_NOWARN) && printk_ratelimit()) { - printk(KERN_WARNING "%s: page allocation failure." - " order:%d, mode:0x%x\n", + unsigned int filter = SHOW_MEM_FILTER_NODES; + + /* + * This documents exceptions given to allocations in certain + * contexts that are allowed to allocate outside current's set + * of allowed nodes. + */ + if (!(gfp_mask & __GFP_NOMEMALLOC)) + if (test_thread_flag(TIF_MEMDIE) || + (current->flags & (PF_MEMALLOC | PF_EXITING))) + filter &= ~SHOW_MEM_FILTER_NODES; + if (in_interrupt() || !wait) + filter &= ~SHOW_MEM_FILTER_NODES; + + pr_warning("%s: page allocation failure. order:%d, mode:0x%x\n", current->comm, order, gfp_mask); dump_stack(); if (!should_suppress_show_mem()) - show_mem(); + __show_mem(filter); } return page; got_pg: