All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] mm, oom: dump stack of victim when reaping failed
@ 2020-01-14 23:20 ` David Rientjes
  0 siblings, 0 replies; 9+ messages in thread
From: David Rientjes @ 2020-01-14 23:20 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Michal Hocko, linux-kernel, linux-mm

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.

Signed-off-by: David Rientjes <rientjes@google.com>
---
 mm/oom_kill.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
--- 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);
 	debug_show_all_locks();
 
 done:

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-01-16 21:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-14 23:20 [patch] mm, oom: dump stack of victim when reaping failed David Rientjes
2020-01-14 23:20 ` David Rientjes
2020-01-15  8:43 ` Michal Hocko
2020-01-15  9:18   ` Tetsuo Handa
2020-01-15 20:27     ` David Rientjes
2020-01-15 20:27       ` David Rientjes
2020-01-15 21:09       ` Tetsuo Handa
2020-01-16 21:05         ` David Rientjes
2020-01-16 21:05           ` David Rientjes

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.