* [PATCH] Make new setting of panic_on_oom
@ 2007-04-20 11:43 Yasunori Goto
2007-04-20 12:41 ` Benjamin LaHaise
0 siblings, 1 reply; 6+ messages in thread
From: Yasunori Goto @ 2007-04-20 11:43 UTC (permalink / raw)
To: Andrew Morton; +Cc: Christoph Lameter, Linux Kernel ML, Larry Woodman
The current panic_on_oom may not work if there is a process using
cpusets/mempolicy, because other nodes' memory may still free.
But some people want failover by panic ASAP even if they are used.
This patch makes new setting for its request.
This is not tested yet. But it would work.
Please apply.
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
---
Documentation/sysctl/vm.txt | 23 +++++++++++++++++------
mm/oom_kill.c | 3 +++
2 files changed, 20 insertions(+), 6 deletions(-)
Index: panic_on_oom2/Documentation/sysctl/vm.txt
===================================================================
--- panic_on_oom2.orig/Documentation/sysctl/vm.txt 2007-04-19 11:19:07.000000000 +0900
+++ panic_on_oom2/Documentation/sysctl/vm.txt 2007-04-19 14:11:24.000000000 +0900
@@ -197,11 +197,22 @@
panic_on_oom
-This enables or disables panic on out-of-memory feature. If this is set to 1,
-the kernel panics when out-of-memory happens. If this is set to 0, the kernel
-will kill some rogue process, called oom_killer. Usually, oom_killer can kill
-rogue processes and system will survive. If you want to panic the system
-rather than killing rogue processes, set this to 1.
+This enables or disables panic on out-of-memory feature.
-The default value is 0.
+If this is set to 0, the kernel will kill some rogue process,
+called oom_killer. Usually, oom_killer can kill rogue processes and
+system will survive.
+
+If this is set to 1, the kernel panics when out-of-memory happens.
+However, if a process limits using nodes by mempolicy/cpusets,
+and those nodes become memory exhaustion status, one process
+may be killed by oom-killer. No panic occurs in this case.
+Because other nodes' memory may be free. This means system total status
+may be not fatal yet.
+If this is set to 2, the kernel panics compulsorily even on the
+above-mentioned.
+
+The default value is 0.
+1 and 2 are for failover of clustering. Please select either
+according to your policy of failover.
Index: panic_on_oom2/mm/oom_kill.c
===================================================================
--- panic_on_oom2.orig/mm/oom_kill.c 2007-04-19 11:27:31.000000000 +0900
+++ panic_on_oom2/mm/oom_kill.c 2007-04-19 12:01:44.000000000 +0900
@@ -412,6 +412,9 @@
cpuset_lock();
read_lock(&tasklist_lock);
+ if (sysctl_panic_on_oom == 2)
+ panic("out of memory. Compulsory panic_on_oom is selected.\n");
+
/*
* Check if there were limitations on the allocation (only relevant for
* NUMA) that may require different handling.
--
Yasunori Goto
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Make new setting of panic_on_oom
2007-04-20 11:43 [PATCH] Make new setting of panic_on_oom Yasunori Goto
@ 2007-04-20 12:41 ` Benjamin LaHaise
2007-04-20 16:16 ` Christoph Lameter
0 siblings, 1 reply; 6+ messages in thread
From: Benjamin LaHaise @ 2007-04-20 12:41 UTC (permalink / raw)
To: Yasunori Goto
Cc: Andrew Morton, Christoph Lameter, Linux Kernel ML, Larry Woodman
On Fri, Apr 20, 2007 at 08:43:56PM +0900, Yasunori Goto wrote:
>
> The current panic_on_oom may not work if there is a process using
> cpusets/mempolicy, because other nodes' memory may still free.
> But some people want failover by panic ASAP even if they are used.
> This patch makes new setting for its request.
>
> This is not tested yet. But it would work.
> read_lock(&tasklist_lock);
>
> + if (sysctl_panic_on_oom == 2)
> + panic("out of memory. Compulsory panic_on_oom is selected.\n");
> +
Wouldn't it be safer to put the panic before the read_lock()?
-ben
--
"Time is of no importance, Mr. President, only life is important."
Don't Email: <zyntrop@kvack.org>.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Make new setting of panic_on_oom
2007-04-20 12:41 ` Benjamin LaHaise
@ 2007-04-20 16:16 ` Christoph Lameter
2007-04-21 4:28 ` Yasunori Goto
0 siblings, 1 reply; 6+ messages in thread
From: Christoph Lameter @ 2007-04-20 16:16 UTC (permalink / raw)
To: Benjamin LaHaise
Cc: Yasunori Goto, Andrew Morton, Linux Kernel ML, Larry Woodman
On Fri, 20 Apr 2007, Benjamin LaHaise wrote:
> On Fri, Apr 20, 2007 at 08:43:56PM +0900, Yasunori Goto wrote:
> >
> > The current panic_on_oom may not work if there is a process using
> > cpusets/mempolicy, because other nodes' memory may still free.
> > But some people want failover by panic ASAP even if they are used.
> > This patch makes new setting for its request.
> >
> > This is not tested yet. But it would work.
>
> > read_lock(&tasklist_lock);
> >
> > + if (sysctl_panic_on_oom == 2)
> > + panic("out of memory. Compulsory panic_on_oom is selected.\n");
> > +
>
> Wouldn't it be safer to put the panic before the read_lock()?
I agree. Otherwise the patch seem to be okay.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Make new setting of panic_on_oom
2007-04-20 16:16 ` Christoph Lameter
@ 2007-04-21 4:28 ` Yasunori Goto
2007-04-21 15:27 ` Benjamin LaHaise
0 siblings, 1 reply; 6+ messages in thread
From: Yasunori Goto @ 2007-04-21 4:28 UTC (permalink / raw)
To: Christoph Lameter
Cc: Benjamin LaHaise, Andrew Morton, Linux Kernel ML, Larry Woodman
> > > read_lock(&tasklist_lock);
> > >
> > > + if (sysctl_panic_on_oom == 2)
> > > + panic("out of memory. Compulsory panic_on_oom is selected.\n");
> > > +
> >
> > Wouldn't it be safer to put the panic before the read_lock()?
>
> I agree. Otherwise the patch seem to be okay.
Ok. This is take 2.
Thanks for your comment.
---------
The current panic_on_oom may not work if there is a process using
cpusets/mempolicy, because other nodes' memory may remain.
But some people want failover by panic ASAP even if they are used.
This patch makes new setting for its request.
This is not tested yet. But it would work.
Please apply.
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
---
Documentation/sysctl/vm.txt | 23 +++++++++++++++++------
mm/oom_kill.c | 3 +++
2 files changed, 20 insertions(+), 6 deletions(-)
Index: panic_on_oom2/Documentation/sysctl/vm.txt
===================================================================
--- panic_on_oom2.orig/Documentation/sysctl/vm.txt 2007-04-21 12:39:09.000000000 +0900
+++ panic_on_oom2/Documentation/sysctl/vm.txt 2007-04-21 12:39:58.000000000 +0900
@@ -197,11 +197,22 @@
panic_on_oom
-This enables or disables panic on out-of-memory feature. If this is set to 1,
-the kernel panics when out-of-memory happens. If this is set to 0, the kernel
-will kill some rogue process, called oom_killer. Usually, oom_killer can kill
-rogue processes and system will survive. If you want to panic the system
-rather than killing rogue processes, set this to 1.
+This enables or disables panic on out-of-memory feature.
-The default value is 0.
+If this is set to 0, the kernel will kill some rogue process,
+called oom_killer. Usually, oom_killer can kill rogue processes and
+system will survive.
+
+If this is set to 1, the kernel panics when out-of-memory happens.
+However, if a process limits using nodes by mempolicy/cpusets,
+and those nodes become memory exhaustion status, one process
+may be killed by oom-killer. No panic occurs in this case.
+Because other nodes' memory may be free. This means system total status
+may be not fatal yet.
+If this is set to 2, the kernel panics compulsorily even on the
+above-mentioned.
+
+The default value is 0.
+1 and 2 are for failover of clustering. Please select either
+according to your policy of failover.
Index: panic_on_oom2/mm/oom_kill.c
===================================================================
--- panic_on_oom2.orig/mm/oom_kill.c 2007-04-21 12:39:09.000000000 +0900
+++ panic_on_oom2/mm/oom_kill.c 2007-04-21 12:40:31.000000000 +0900
@@ -409,6 +409,9 @@
show_mem();
}
+ if (sysctl_panic_on_oom == 2)
+ panic("out of memory. Compulsory panic_on_oom is selected.\n");
+
cpuset_lock();
read_lock(&tasklist_lock);
--
Yasunori Goto
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Make new setting of panic_on_oom
2007-04-21 4:28 ` Yasunori Goto
@ 2007-04-21 15:27 ` Benjamin LaHaise
2007-04-24 5:14 ` Yasunori Goto
0 siblings, 1 reply; 6+ messages in thread
From: Benjamin LaHaise @ 2007-04-21 15:27 UTC (permalink / raw)
To: Yasunori Goto
Cc: Christoph Lameter, Andrew Morton, Linux Kernel ML, Larry Woodman
On Sat, Apr 21, 2007 at 01:28:16PM +0900, Yasunori Goto wrote:
> Ok. This is take 2.
> Thanks for your comment.
>
> Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Looks good. Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
-ben
--
"Time is of no importance, Mr. President, only life is important."
Don't Email: <zyntrop@kvack.org>.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Make new setting of panic_on_oom
2007-04-21 15:27 ` Benjamin LaHaise
@ 2007-04-24 5:14 ` Yasunori Goto
0 siblings, 0 replies; 6+ messages in thread
From: Yasunori Goto @ 2007-04-24 5:14 UTC (permalink / raw)
To: Andrew Morton
Cc: Christoph Lameter, Linux Kernel ML, Larry Woodman,
Benjamin LaHaise
I tested this patch. It worked well.
So, I fixed its description.
Please apply.
----------
The current panic_on_oom may not work if there is a process using
cpusets/mempolicy, because other nodes' memory may remain.
But some people want failover by panic ASAP even if they are used.
This patch makes new setting for its request.
This is tested on my ia64 box which has 3 nodes.
Please apply.
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
---
Documentation/sysctl/vm.txt | 23 +++++++++++++++++------
mm/oom_kill.c | 3 +++
2 files changed, 20 insertions(+), 6 deletions(-)
Index: panic_on_oom2/Documentation/sysctl/vm.txt
===================================================================
--- panic_on_oom2.orig/Documentation/sysctl/vm.txt 2007-04-21 12:39:09.000000000 +0900
+++ panic_on_oom2/Documentation/sysctl/vm.txt 2007-04-21 12:39:58.000000000 +0900
@@ -197,11 +197,22 @@
panic_on_oom
-This enables or disables panic on out-of-memory feature. If this is set to 1,
-the kernel panics when out-of-memory happens. If this is set to 0, the kernel
-will kill some rogue process, called oom_killer. Usually, oom_killer can kill
-rogue processes and system will survive. If you want to panic the system
-rather than killing rogue processes, set this to 1.
+This enables or disables panic on out-of-memory feature.
-The default value is 0.
+If this is set to 0, the kernel will kill some rogue process,
+called oom_killer. Usually, oom_killer can kill rogue processes and
+system will survive.
+
+If this is set to 1, the kernel panics when out-of-memory happens.
+However, if a process limits using nodes by mempolicy/cpusets,
+and those nodes become memory exhaustion status, one process
+may be killed by oom-killer. No panic occurs in this case.
+Because other nodes' memory may be free. This means system total status
+may be not fatal yet.
+If this is set to 2, the kernel panics compulsorily even on the
+above-mentioned.
+
+The default value is 0.
+1 and 2 are for failover of clustering. Please select either
+according to your policy of failover.
Index: panic_on_oom2/mm/oom_kill.c
===================================================================
--- panic_on_oom2.orig/mm/oom_kill.c 2007-04-21 12:39:09.000000000 +0900
+++ panic_on_oom2/mm/oom_kill.c 2007-04-21 12:40:31.000000000 +0900
@@ -409,6 +409,9 @@
show_mem();
}
+ if (sysctl_panic_on_oom == 2)
+ panic("out of memory. Compulsory panic_on_oom is selected.\n");
+
cpuset_lock();
read_lock(&tasklist_lock);
--
Yasunori Goto
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-04-24 5:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-20 11:43 [PATCH] Make new setting of panic_on_oom Yasunori Goto
2007-04-20 12:41 ` Benjamin LaHaise
2007-04-20 16:16 ` Christoph Lameter
2007-04-21 4:28 ` Yasunori Goto
2007-04-21 15:27 ` Benjamin LaHaise
2007-04-24 5:14 ` Yasunori Goto
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.