diff options
| author | David Rientjes <rientjes@google.com> | 2014-08-06 19:07:50 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-06 21:01:21 -0400 |
| commit | 8d060bf490930f305c4efc45724e861a268f4d2f (patch) | |
| tree | 96c2c1ee46be53f13d73f365cbbf3615325738b1 /include/linux | |
| parent | 6e90b58be7545c2cb2306fa186ccf5888c76c559 (diff) | |
mm, oom: ensure memoryless node zonelist always includes zones
With memoryless node support being worked on, it's possible that for
optimizations that a node may not have a non-NULL zonelist. When
CONFIG_NUMA is enabled and node 0 is memoryless, this means the zonelist
for first_online_node may become NULL.
The oom killer requires a zonelist that includes all memory zones for
the sysrq trigger and pagefault out of memory handler.
Ensure that a non-NULL zonelist is always passed to the oom killer.
[akpm@linux-foundation.org: fix non-numa build]
Signed-off-by: David Rientjes <rientjes@google.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/nodemask.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index 58b9a02c38d2..83a6aeda899d 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h | |||
| @@ -430,7 +430,15 @@ static inline int num_node_state(enum node_states state) | |||
| 430 | for_each_node_mask((__node), node_states[__state]) | 430 | for_each_node_mask((__node), node_states[__state]) |
| 431 | 431 | ||
| 432 | #define first_online_node first_node(node_states[N_ONLINE]) | 432 | #define first_online_node first_node(node_states[N_ONLINE]) |
| 433 | #define next_online_node(nid) next_node((nid), node_states[N_ONLINE]) | 433 | #define first_memory_node first_node(node_states[N_MEMORY]) |
| 434 | static inline int next_online_node(int nid) | ||
| 435 | { | ||
| 436 | return next_node(nid, node_states[N_ONLINE]); | ||
| 437 | } | ||
| 438 | static inline int next_memory_node(int nid) | ||
| 439 | { | ||
| 440 | return next_node(nid, node_states[N_MEMORY]); | ||
| 441 | } | ||
| 434 | 442 | ||
| 435 | extern int nr_node_ids; | 443 | extern int nr_node_ids; |
| 436 | extern int nr_online_nodes; | 444 | extern int nr_online_nodes; |
| @@ -471,6 +479,7 @@ static inline int num_node_state(enum node_states state) | |||
| 471 | for ( (node) = 0; (node) == 0; (node) = 1) | 479 | for ( (node) = 0; (node) == 0; (node) = 1) |
| 472 | 480 | ||
| 473 | #define first_online_node 0 | 481 | #define first_online_node 0 |
| 482 | #define first_memory_node 0 | ||
| 474 | #define next_online_node(nid) (MAX_NUMNODES) | 483 | #define next_online_node(nid) (MAX_NUMNODES) |
| 475 | #define nr_node_ids 1 | 484 | #define nr_node_ids 1 |
| 476 | #define nr_online_nodes 1 | 485 | #define nr_online_nodes 1 |
