Commit:     96ac5913f4e45c6a1b98350f2c0a8bb3abe2646a
Parent:     e4e6bdbb426d1ecd9e4587f22115f8d0d426d21f
Author:     KAMEZAWA Hiroyuki <[EMAIL PROTECTED]>
AuthorDate: Fri Dec 29 16:47:20 2006 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Sat Dec 30 10:55:55 2006 -0800

    [PATCH] fix oom killer kills current every time if there is 
memory-less-node take2
    constrained_alloc(), which is called to detect where oom is from, checks
    passed zone_list().  If zone_list doesn't include all nodes, it thinks oom
    is from mempolicy.
    But there is memory-less-node.  memory-less-node's zones are never included
    in zonelist[].
    contstrained_alloc() should get memory_less_node into count.  Otherwise, it
    always thinks 'oom is from mempolicy'.  This means that current process
    dies at any time.  This patch fix it.
    Signed-off-by: KAMEZAWA Hiroyuki <[EMAIL PROTECTED]>
    Cc: Paul Jackson <[EMAIL PROTECTED]>
    Cc: Christoph Lameter <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 mm/oom_kill.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 64cf3c2..6969cfb 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -174,7 +174,12 @@ static inline int constrained_alloc(struct zonelist 
*zonelist, gfp_t gfp_mask)
        struct zone **z;
-       nodemask_t nodes = node_online_map;
+       nodemask_t nodes;
+       int node;
+       /* node has memory ? */
+       for_each_online_node(node)
+               if (NODE_DATA(node)->node_present_pages)
+                       node_set(node, nodes);
        for (z = zonelist->zones; *z; z++)
                if (cpuset_zone_allowed_softwall(*z, gfp_mask))
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to