All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eddie James <eajames@linux.ibm.com>
To: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	Eddie James <eajames@linux.ibm.com>
Subject: [PATCH] mm: Add config option for default panic_on_oom value
Date: Wed, 11 May 2022 13:34:00 -0500	[thread overview]
Message-ID: <20220511183400.47940-1-eajames@linux.ibm.com> (raw)

Add the option to kconfig and set the default panic_on_value.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
---
 mm/Kconfig    | 7 +++++++
 mm/oom_kill.c | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/mm/Kconfig b/mm/Kconfig
index 675a6be43739..1fde865b0a63 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -825,6 +825,13 @@ config ZSMALLOC_STAT
 config GENERIC_EARLY_IOREMAP
 	bool
 
+config PANIC_ON_OOM_DEFAULT
+	int "Startup setting for panic_on_oom"
+	default 0
+	range 0 2
+	help
+	  This is the default startup value for /proc/sys/vm/panic_on_oom
+
 config STACK_MAX_DEFAULT_SIZE_MB
 	int "Default maximum user stack size for 32-bit processes (MB)"
 	default 100
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 3996301450e8..a6a9cc5635f8 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -52,7 +52,7 @@
 #define CREATE_TRACE_POINTS
 #include <trace/events/oom.h>
 
-static int sysctl_panic_on_oom;
+static int sysctl_panic_on_oom = CONFIG_PANIC_ON_OOM_DEFAULT;
 static int sysctl_oom_kill_allocating_task;
 static int sysctl_oom_dump_tasks = 1;
 
-- 
2.27.0



             reply	other threads:[~2022-05-11 18:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-11 18:34 Eddie James [this message]
2022-05-11 21:56 ` [PATCH] mm: Add config option for default panic_on_oom value Andrew Morton
2022-05-11 22:06   ` Eddie James
2022-05-11 22:36     ` Andrew Morton
2022-05-12 14:01       ` Eddie James

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=20220511183400.47940-1-eajames@linux.ibm.com \
    --to=eajames@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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 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.