[BUG][PATCH] fix oom killer kills current every time if there is memory-less-node take2

2006-12-22 Thread KAMEZAWA Hiroyuki
Fixed patch comment.

-Kame
==
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]>



 mm/oom_kill.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletion(-)

Index: devel-2.6.20-rc1-mm1/mm/oom_kill.c
===
--- devel-2.6.20-rc1-mm1.orig/mm/oom_kill.c 2006-12-16 13:47:59.0 
+0900
+++ devel-2.6.20-rc1-mm1/mm/oom_kill.c  2006-12-22 12:11:55.0 +0900
@@ -174,7 +174,12 @@
 {
 #ifdef CONFIG_NUMA
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 linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[BUG][PATCH] fix oom killer kills current every time if there is memory-less-node take2

2006-12-22 Thread KAMEZAWA Hiroyuki
Fixed patch comment.

-Kame
==
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]



 mm/oom_kill.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletion(-)

Index: devel-2.6.20-rc1-mm1/mm/oom_kill.c
===
--- devel-2.6.20-rc1-mm1.orig/mm/oom_kill.c 2006-12-16 13:47:59.0 
+0900
+++ devel-2.6.20-rc1-mm1/mm/oom_kill.c  2006-12-22 12:11:55.0 +0900
@@ -174,7 +174,12 @@
 {
 #ifdef CONFIG_NUMA
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 linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [BUG][PATCH] fix oom killer kills current every time if there is memory-less-node

2006-12-21 Thread KAMEZAWA Hiroyuki
On Thu, 21 Dec 2006 21:18:12 -0800
Paul Jackson <[EMAIL PROTECTED]> wrote:

> KAMEZAWA-san wrote:
> > But there is memory-less-node. contstrained_alloc() should get
> > memory_less_node into count.
> 
> This patch looks ok to me.
> 
> One line in the patch comment seems backward:
> 
>   If zone_list includes all nodes, it thinks oom is from mempolicy.
> 
> Shouldn't that be:
> 
>   If zone_list doesn't include all nodes, it thinks oom is from mempolicy.
> 
Ah, yes. (>_<, Thank you.

-Kame

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [BUG][PATCH] fix oom killer kills current every time if there is memory-less-node

2006-12-21 Thread Paul Jackson
KAMEZAWA-san wrote:
> But there is memory-less-node. contstrained_alloc() should get
> memory_less_node into count.

This patch looks ok to me.

One line in the patch comment seems backward:

  If zone_list includes all nodes, it thinks oom is from mempolicy.

Shouldn't that be:

  If zone_list doesn't include all nodes, it thinks oom is from mempolicy.

-- 
  I won't rest till it's the best ...
  Programmer, Linux Scalability
  Paul Jackson <[EMAIL PROTECTED]> 1.925.600.0401
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[BUG][PATCH] fix oom killer kills current every time if there is memory-less-node

2006-12-21 Thread KAMEZAWA Hiroyuki
constrained_alloc(), which is called to detect where oom is from,
checks passed zone_list().
If zone_list includes all nodes, it thinks oom is from mempolicy.

But there is memory-less-node. contstrained_alloc() should get
memory_less_node into count. Otherwise, current process will die
at any time. This patch fix it.

Signed-Off-By: KAMEZAWA Hiroyuki <[EMAIL PROTECTED]>



 mm/oom_kill.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletion(-)

Index: devel-2.6.20-rc1-mm1/mm/oom_kill.c
===
--- devel-2.6.20-rc1-mm1.orig/mm/oom_kill.c 2006-12-16 13:47:59.0 
+0900
+++ devel-2.6.20-rc1-mm1/mm/oom_kill.c  2006-12-22 12:11:55.0 +0900
@@ -174,7 +174,12 @@
 {
 #ifdef CONFIG_NUMA
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 linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[BUG][PATCH] fix oom killer kills current every time if there is memory-less-node

2006-12-21 Thread KAMEZAWA Hiroyuki
constrained_alloc(), which is called to detect where oom is from,
checks passed zone_list().
If zone_list includes all nodes, it thinks oom is from mempolicy.

But there is memory-less-node. contstrained_alloc() should get
memory_less_node into count. Otherwise, current process will die
at any time. This patch fix it.

Signed-Off-By: KAMEZAWA Hiroyuki [EMAIL PROTECTED]



 mm/oom_kill.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletion(-)

Index: devel-2.6.20-rc1-mm1/mm/oom_kill.c
===
--- devel-2.6.20-rc1-mm1.orig/mm/oom_kill.c 2006-12-16 13:47:59.0 
+0900
+++ devel-2.6.20-rc1-mm1/mm/oom_kill.c  2006-12-22 12:11:55.0 +0900
@@ -174,7 +174,12 @@
 {
 #ifdef CONFIG_NUMA
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 linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [BUG][PATCH] fix oom killer kills current every time if there is memory-less-node

2006-12-21 Thread Paul Jackson
KAMEZAWA-san wrote:
 But there is memory-less-node. contstrained_alloc() should get
 memory_less_node into count.

This patch looks ok to me.

One line in the patch comment seems backward:

  If zone_list includes all nodes, it thinks oom is from mempolicy.

Shouldn't that be:

  If zone_list doesn't include all nodes, it thinks oom is from mempolicy.

-- 
  I won't rest till it's the best ...
  Programmer, Linux Scalability
  Paul Jackson [EMAIL PROTECTED] 1.925.600.0401
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [BUG][PATCH] fix oom killer kills current every time if there is memory-less-node

2006-12-21 Thread KAMEZAWA Hiroyuki
On Thu, 21 Dec 2006 21:18:12 -0800
Paul Jackson [EMAIL PROTECTED] wrote:

 KAMEZAWA-san wrote:
  But there is memory-less-node. contstrained_alloc() should get
  memory_less_node into count.
 
 This patch looks ok to me.
 
 One line in the patch comment seems backward:
 
   If zone_list includes all nodes, it thinks oom is from mempolicy.
 
 Shouldn't that be:
 
   If zone_list doesn't include all nodes, it thinks oom is from mempolicy.
 
Ah, yes. (_, Thank you.

-Kame

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/