Patch "oom: improve oom disable handling" has been added to the 4.9-stable tree
Subsystems (4)
This is a note to let you know that I've just added the patch titled
oom: improve oom disable handling
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
oom-improve-oom-disable-handling.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Thu Mar 22 14:40:24 CET 2018
From: Michal Hocko <[email protected]>
Date: Wed, 3 May 2017 14:54:57 -0700
Subject: oom: improve oom disable handling
From: Michal Hocko <[email protected]>
[ Upstream commit d75da004c708c9fca7b53f7da293a295522414d9 ]
Tetsuo has reported that sysrq triggered OOM killer will print a misleading information when no tasks are selected:
sysrq: SysRq : Manual OOM execution
Out of memory: Kill process 4468 ((agetty)) score 0 or sacrifice child
Killed process 4468 ((agetty)) total-vm:43704kB, anon-rss:1760kB, file-rss:0kB, shmem-rss:0kB
sysrq: SysRq : Manual OOM execution
Out of memory: Kill process 4469 (systemd-cgroups) score 0 or sacrifice child Killed process 4469 (systemd-cgroups) total-vm:10704kB, anon-rss:120kB, file-rss:0kB, shmem-rss:0kB
sysrq: SysRq : Manual OOM execution
sysrq: OOM request ignored because killer is disabled
sysrq: SysRq : Manual OOM execution
sysrq: OOM request ignored because killer is disabled
sysrq: SysRq : Manual OOM execution
sysrq: OOM request ignored because killer is disabled
The real reason is that there are no eligible tasks for the OOM killer to select but since commit 7c5f64f84483 ("mm: oom: deduplicate victim selection code for memcg and global oom") the semantic of out_of_memory has changed without updating moom_callback.
This patch updates moom_callback to tell that no task was eligible which is the case for both oom killer disabled and no eligible tasks. In order to help distinguish first case from the second add printk to both oom_killer_{enable,disable}. This information is useful on its own because it might help debugging potential memory allocation failures.
--- drivers/tty/sysrq.c | 2 +- mm/oom_kill.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/tty/sysrq.c +1 -1
@@ -375,7 +375,7 @@ static void moom_callback(struct work_stmutex_lock (&oom_lock);if (!out_of_memory (&oc)) -pr_info ("OOM request ignored because killer is disabled\n" ); +pr_info ("OOM request ignored. No task eligible\n" );mutex_unlock (&oom_lock); }
mm/oom_kill.c +2 -0
@@ -706,6 +706,7 @@ void exit_oom_victim(void)void oom_killer_enable (void ) { oom_killer_disabled = false; +pr_info ("OOM killer enabled.\n" ); }/**
@@ -742,6 +743,7 @@ bool oom_killer_disable(signed long timeoom_killer_enable ();return false; } +pr_info ("OOM killer disabled.\n" );return true; }
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/mm-fix-check-for-reclaimable-pages-in-pf_memalloc-reclaim-throttling.patch queue-4.9/oom-improve-oom-disable-handling.patch
Greg, this doesn't really look like a fix that should go to the stable tree. It doesn't really fix any serious bug.
Quoted 85 lines · Greg KH
Quoted 1 line
From foo@baz Thu Mar 22 14:40:24 CET 2018
From: Michal Hocko <[email protected]>
Date: Wed, 3 May 2017 14:54:57 -0700
Subject: oom: improve oom disable handlingFrom: Michal Hocko <[email protected]>
[ Upstream commit
d75da004c708c9fca7b53f7da293a295522414d9]Tetsuo has reported that sysrq triggered OOM killer will print a misleading information when no tasks are selected:
sysrq: SysRq : Manual OOM execution
Out of memory: Kill process 4468 ((agetty)) score 0 or sacrifice child
Killed process 4468 ((agetty)) total-vm:43704kB, anon-rss:1760kB, file-rss:0kB, shmem-rss:0kB
sysrq: SysRq : Manual OOM execution
Out of memory: Kill process 4469 (systemd-cgroups) score 0 or sacrifice child Killed process 4469 (systemd-cgroups) total-vm:10704kB, anon-rss:120kB, file-rss:0kB, shmem-rss:0kB
sysrq: SysRq : Manual OOM execution
sysrq: OOM request ignored because killer is disabled
sysrq: SysRq : Manual OOM execution
sysrq: OOM request ignored because killer is disabled
sysrq: SysRq : Manual OOM execution
sysrq: OOM request ignored because killer is disabledThe real reason is that there are no eligible tasks for the OOM killer to select but since commit
7c5f64f84483("mm: oom: deduplicate victim selection code for memcg and global oom") the semantic ofout_of_memoryhas changed without updatingmoom_callback.This patch updates
moom_callbackto tell that no task was eligible which is the case for both oom killer disabled and no eligible tasks. In order to help distinguish first case from the second add printk to both oom_killer_{enable,disable}. This information is useful on its own because it might help debugging potential memory allocation failures.Fixes 7c5f64f84483 ("mm: oom: deduplicate victim selection code for memcg and global oom")Signed-off-by Michal Hocko <[email protected]>Reported-by Tetsuo Handa <[email protected]>Signed-off-by Andrew Morton <[email protected]>Signed-off-by Linus Torvalds <[email protected]>Signed-off-by Sasha Levin <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/tty/sysrq.c | 2 +- mm/oom_kill.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)drivers/tty/sysrq.c +1
-1@@ -375,7 +375,7 @@ static void moom_callback(struct work_stmutex_lock (&oom_lock);if (!out_of_memory (&oc)) -pr_info ("OOM request ignored because killer is disabled\n" ); +pr_info ("OOM request ignored. No task eligible\n" );mutex_unlock (&oom_lock); }mm/oom_kill.c +2
-0@@ -706,6 +706,7 @@ void exit_oom_victim(void)void oom_killer_enable (void ) { oom_killer_disabled = false; +pr_info ("OOM killer enabled.\n" ); }/** @@ -742,6 +743,7 @@ bool oom_killer_disable(signed long timeoom_killer_enable ();return false; } +pr_info ("OOM killer disabled.\n" );return true; }Patches currently in stable-queue which might be from [email protected] are
queue-4.9/mm-fix-check-for-reclaimable-pages-in-pf_memalloc-reclaim-throttling.patchqueue-4.9/oom-improve-oom-disable-handling.patch
Signature · 2 lines
Michal Hocko SUSE Labs
Greg KH
maintainerQuoted 2 lines · Michal Hocko
Greg, this doesn't really look like a fix that should go to the stable tree. It doesn't really fix any serious bug.
Thanks for letting me know, now dropped.
greg k-h