提交 cbf978bf 编写于 作者: D David Rientjes 提交者: Linus Torvalds

oom: suppress nodes that are not allowed from meminfo on page alloc failure

Displaying extremely verbose meminfo for all nodes on the system is
overkill for page allocation failures when the context restricts that
allocation to only a subset of nodes.  We don't particularly care about
the state of all nodes when some are not allowed in the current context,
they can have an abundance of memory but we can't allocate from that part
of memory.

This patch suppresses disallowed nodes from the meminfo dump on a page
allocation failure if the context requires it.
Signed-off-by: NDavid Rientjes <rientjes@google.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 29423e77
...@@ -2171,12 +2171,25 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, ...@@ -2171,12 +2171,25 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
nopage: nopage:
if (!(gfp_mask & __GFP_NOWARN) && printk_ratelimit()) { if (!(gfp_mask & __GFP_NOWARN) && printk_ratelimit()) {
printk(KERN_WARNING "%s: page allocation failure." unsigned int filter = SHOW_MEM_FILTER_NODES;
" order:%d, mode:0x%x\n",
/*
* 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); current->comm, order, gfp_mask);
dump_stack(); dump_stack();
if (!should_suppress_show_mem()) if (!should_suppress_show_mem())
show_mem(); __show_mem(filter);
} }
return page; return page;
got_pg: got_pg:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册