path: root/mm
diff options
authorDavid Rientjes <>2020-01-30 22:14:26 -0800
committerLinus Torvalds <>2020-01-31 10:30:38 -0800
commit8a7ff02acabbd877669fecb0a2e75d0930b62c85 (patch)
treeb2860820529296eb85d8268147f64af18433accc /mm
parenta090d711dd2ebd7e445bf09f98a4feba6c22f2ff (diff)
mm, oom: dump stack of victim when reaping failed
When a process cannot be oom reaped, for whatever reason, currently the list of locks that are held is currently dumped to the kernel log. Much more interesting is the stack trace of the victim that cannot be reaped. If the stack trace is dumped, we have the ability to find related occurrences in the same kernel code and hopefully solve the issue that is making it wedged. Dump the stack trace when a process fails to be oom reaped. Link: Signed-off-by: David Rientjes <> Acked-by: Michal Hocko <> Cc: Tetsuo Handa <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'mm')
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index d58c481b3df8..dfc357614e56 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -26,6 +26,7 @@
#include <linux/sched/mm.h>
#include <linux/sched/coredump.h>
#include <linux/sched/task.h>
+#include <linux/sched/debug.h>
#include <linux/swap.h>
#include <linux/timex.h>
#include <linux/jiffies.h>
@@ -620,6 +621,7 @@ static void oom_reap_task(struct task_struct *tsk)
pr_info("oom_reaper: unable to reap pid:%d (%s)\n",
task_pid_nr(tsk), tsk->comm);
+ sched_show_task(tsk);