* [PATCH] syzbot: Dump all threads upon OOM.
@ 2018-09-07 11:23 Tetsuo Handa
2018-09-07 12:57 ` Dmitry Vyukov
0 siblings, 1 reply; 3+ messages in thread
From: Tetsuo Handa @ 2018-09-07 11:23 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-mm, Tetsuo Handa, Dmitry Vyukov, Michal Hocko
syzbot is getting stalls with linux-next kernels because dump_tasks() from
out_of_memory() is printing 6600 tasks. Most of these tasks are syzbot
processes but syzbot is supposed not to create so many processes.
Therefore, let's start from checking what these tasks are doing.
This change will be removed after the bug is fixed.
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Michal Hocko <mhocko@kernel.org>
---
mm/oom_kill.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index f10aa53..867fd6a 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -41,6 +41,7 @@
#include <linux/kthread.h>
#include <linux/init.h>
#include <linux/mmu_notifier.h>
+#include <linux/sched/debug.h>
#include <asm/tlb.h>
#include "internal.h"
@@ -446,6 +447,10 @@ static void dump_header(struct oom_control *oc, struct task_struct *p)
if (is_dump_unreclaim_slabs())
dump_unreclaimable_slab();
}
+#ifdef CONFIG_DEBUG_AID_FOR_SYZBOT
+ show_state();
+ panic("Out of memory");
+#endif
if (sysctl_oom_dump_tasks)
dump_tasks(oc->memcg, oc->nodemask);
}
--
1.8.3.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] syzbot: Dump all threads upon OOM.
2018-09-07 11:23 [PATCH] syzbot: Dump all threads upon OOM Tetsuo Handa
@ 2018-09-07 12:57 ` Dmitry Vyukov
2018-09-07 13:21 ` [PATCH v2] syzbot: Dump all threads upon global OOM Tetsuo Handa
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Vyukov @ 2018-09-07 12:57 UTC (permalink / raw)
To: Tetsuo Handa; +Cc: Andrew Morton, Linux-MM, Michal Hocko
On Fri, Sep 7, 2018 at 1:23 PM, Tetsuo Handa
<penguin-kernel@i-love.sakura.ne.jp> wrote:
> syzbot is getting stalls with linux-next kernels because dump_tasks() from
> out_of_memory() is printing 6600 tasks. Most of these tasks are syzbot
> processes but syzbot is supposed not to create so many processes.
> Therefore, let's start from checking what these tasks are doing.
> This change will be removed after the bug is fixed.
>
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Cc: Dmitry Vyukov <dvyukov@google.com>
> Cc: Michal Hocko <mhocko@kernel.org>
> ---
> mm/oom_kill.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/mm/oom_kill.c b/mm/oom_kill.c
> index f10aa53..867fd6a 100644
> --- a/mm/oom_kill.c
> +++ b/mm/oom_kill.c
> @@ -41,6 +41,7 @@
> #include <linux/kthread.h>
> #include <linux/init.h>
> #include <linux/mmu_notifier.h>
> +#include <linux/sched/debug.h>
>
> #include <asm/tlb.h>
> #include "internal.h"
> @@ -446,6 +447,10 @@ static void dump_header(struct oom_control *oc, struct task_struct *p)
> if (is_dump_unreclaim_slabs())
> dump_unreclaimable_slab();
> }
> +#ifdef CONFIG_DEBUG_AID_FOR_SYZBOT
> + show_state();
> + panic("Out of memory");
won't this panic on every oom?
we have lots of oom's, especially inside of cgroups, but probably global too
it would be bad if we crash all machines this way
> +#endif
> if (sysctl_oom_dump_tasks)
> dump_tasks(oc->memcg, oc->nodemask);
> }
> --
> 1.8.3.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] syzbot: Dump all threads upon global OOM.
2018-09-07 12:57 ` Dmitry Vyukov
@ 2018-09-07 13:21 ` Tetsuo Handa
0 siblings, 0 replies; 3+ messages in thread
From: Tetsuo Handa @ 2018-09-07 13:21 UTC (permalink / raw)
To: Dmitry Vyukov; +Cc: Andrew Morton, Linux-MM, Michal Hocko
On 2018/09/07 21:57, Dmitry Vyukov wrote:
>> @@ -446,6 +447,10 @@ static void dump_header(struct oom_control *oc, struct task_struct *p)
>> if (is_dump_unreclaim_slabs())
>> dump_unreclaimable_slab();
>> }
>> +#ifdef CONFIG_DEBUG_AID_FOR_SYZBOT
>> + show_state();
>> + panic("Out of memory");
>
> won't this panic on every oom?
> we have lots of oom's, especially inside of cgroups, but probably global too
> it would be bad if we crash all machines this way
>
>
OK. Here is updated patch.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-09-07 13:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-07 11:23 [PATCH] syzbot: Dump all threads upon OOM Tetsuo Handa
2018-09-07 12:57 ` Dmitry Vyukov
2018-09-07 13:21 ` [PATCH v2] syzbot: Dump all threads upon global OOM Tetsuo Handa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox