linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	clameter@engr.sgi.com, riel@redhat.com, dgc@sgi.com
Subject: Re: [PATCH] support for panic at OOM
Date: Tue, 11 Apr 2006 23:59:07 -0700	[thread overview]
Message-ID: <20060411235907.6a59ecba.akpm@osdl.org> (raw)
In-Reply-To: <20060412155301.10d611ca.kamezawa.hiroyu@jp.fujitsu.com>

KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
>
> This patch adds a feature to panic at OOM, oom_die.

Makes sense I guess.

> ===================================================================
> --- linux-2.6.17-rc1-mm2.orig/kernel/sysctl.c
> +++ linux-2.6.17-rc1-mm2/kernel/sysctl.c
> @@ -60,6 +60,7 @@ extern int proc_nr_files(ctl_table *tabl
>  extern int C_A_D;
>  extern int sysctl_overcommit_memory;
>  extern int sysctl_overcommit_ratio;
> +extern int sysctl_oom_die;
>  extern int max_threads;
>  extern int sysrq_enabled;
>  extern int core_uses_pid;

One day we should create a header file for all these.

> @@ -718,6 +719,14 @@ static ctl_table vm_table[] = {
>  		.proc_handler	= &proc_dointvec,
>  	},
>  	{
> +		.ctl_name	= VM_OOM_DIE,
> +		.procname	= "oom_die",

I'd suggest it be called "panic_on_oom".  Like the current panic_on_oops.

> +int sysctl_oom_die = 0;

The initialisation is unneeded.

> +static void oom_die(void)
> +{
> +	panic("Panic: out of memory: oom_die is selected.");
> +}
> +
>  /**
>   * oom_kill - kill the "best" process when we run out of memory
>   *
> @@ -331,6 +337,8 @@ void out_of_memory(struct zonelist *zone
>  
>  	case CONSTRAINT_NONE:
>  retry:
> +		if (sysctl_oom_die)
> +			oom_die();

I don't think we need a separate function for this?

Please document the new sysctl in Documentation/sysctl/.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2006-04-12  6:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-12  6:53 KAMEZAWA Hiroyuki
2006-04-12  6:59 ` Andrew Morton [this message]
2006-04-12  7:06   ` KAMEZAWA Hiroyuki
2006-04-12  8:23   ` KAMEZAWA Hiroyuki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060411235907.6a59ecba.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=clameter@engr.sgi.com \
    --cc=dgc@sgi.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=riel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox