diff options
author | David Rientjes <rientjes@google.com> | 2011-03-22 19:30:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-22 20:44:01 -0400 |
commit | cbf978bfb12d7deca97d7333f65eda0381a072de (patch) | |
tree | 75a415ec997606460c0c851f43e29d008476f231 /mm | |
parent | 29423e77c06cee7d4e335ef4a7cbd949da978c91 (diff) |
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: David 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/page_alloc.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2aaafe82f513..36a168e383b5 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -2171,12 +2171,25 @@ rebalance: | |||
2171 | 2171 | ||
2172 | nopage: | 2172 | nopage: |
2173 | if (!(gfp_mask & __GFP_NOWARN) && printk_ratelimit()) { | 2173 | if (!(gfp_mask & __GFP_NOWARN) && printk_ratelimit()) { |
2174 | printk(KERN_WARNING "%s: page allocation failure." | 2174 | unsigned int filter = SHOW_MEM_FILTER_NODES; |
2175 | " order:%d, mode:0x%x\n", | 2175 | |
2176 | /* | ||
2177 | * This documents exceptions given to allocations in certain | ||
2178 | * contexts that are allowed to allocate outside current's set | ||
2179 | * of allowed nodes. | ||
2180 | */ | ||
2181 | if (!(gfp_mask & __GFP_NOMEMALLOC)) | ||
2182 | if (test_thread_flag(TIF_MEMDIE) || | ||
2183 | (current->flags & (PF_MEMALLOC | PF_EXITING))) | ||
2184 | filter &= ~SHOW_MEM_FILTER_NODES; | ||
2185 | if (in_interrupt() || !wait) | ||
2186 | filter &= ~SHOW_MEM_FILTER_NODES; | ||
2187 | |||
2188 | pr_warning("%s: page allocation failure. order:%d, mode:0x%x\n", | ||
2176 | current->comm, order, gfp_mask); | 2189 | current->comm, order, gfp_mask); |
2177 | dump_stack(); | 2190 | dump_stack(); |
2178 | if (!should_suppress_show_mem()) | 2191 | if (!should_suppress_show_mem()) |
2179 | show_mem(); | 2192 | __show_mem(filter); |
2180 | } | 2193 | } |
2181 | return page; | 2194 | return page; |
2182 | got_pg: | 2195 | got_pg: |