diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug index adfdd670f951..46615e0bdb35 100644 --- a/mm/Kconfig.debug +++ b/mm/Kconfig.debug @@ -48,6 +48,14 @@ config SLUB_DEBUG_PANIC_ON investigating the root cause which may be rooted within cache or memory. +config DEBUG_PANIC_ON_OOM + bool "Enable to Panic on OOM detection" + help + Android primarily uses an alternative mechanism to detect low + memory situations and kill processes as required. The kernel + oom-killer can mask problems with this feature, which may be + undesireable in a debug environment. + config DEBUG_PAGEALLOC_ENABLE_DEFAULT bool "Enable debug page memory allocations by default?" depends on DEBUG_PAGEALLOC diff --git a/mm/oom_kill.c b/mm/oom_kill.c index e533368a9cee..1b076aa6a1e6 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -52,7 +52,8 @@ #define CREATE_TRACE_POINTS #include -int sysctl_panic_on_oom; +int sysctl_panic_on_oom = +IS_ENABLED(CONFIG_DEBUG_PANIC_ON_OOM) ? 2 : 0; int sysctl_oom_kill_allocating_task; int sysctl_oom_dump_tasks = 1; int sysctl_reap_mem_on_sigkill;