From de0a15b7ea35d84b256bdcac2174aa945453f7a1 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Fri, 27 Jul 2007 15:43:42 -0400 Subject: [PATCH] OOM: use the N_HIGH_MEMORY map instead of constructing one on the fly constrained_alloc() builds its own memory map for nodes with memory. We have that available in N_HIGH_MEMORY now. So simplify the code. Signed-off-by: Christoph Lameter Acked-by: Nishanth Aravamudan Acked-by: Lee Schermerhorn Acked-by: Bob Picco Index: linux-2.6/mm/oom_kill.c =================================================================== --- linux-2.6.orig/mm/oom_kill.c 2007-07-31 21:08:00.000000000 -0700 +++ linux-2.6/mm/oom_kill.c 2007-07-31 21:19:24.000000000 -0700 @@ -177,14 +177,7 @@ static inline int constrained_alloc(stru { #ifdef CONFIG_NUMA struct zone **z; - nodemask_t nodes; - int node; - - nodes_clear(nodes); - /* node has memory ? */ - for_each_online_node(node) - if (NODE_DATA(node)->node_present_pages) - node_set(node, nodes); + nodemask_t nodes = node_states[N_HIGH_MEMORY]; for (z = zonelist->zones; *z; z++) if (cpuset_zone_allowed_softwall(*z, gfp_mask))