From: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
To: Dmitry Vyukov <dvyukov-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: Michal Hocko <mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org"
<linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org>,
Andrew Morton
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
syzkaller <syzkaller-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>,
Kostya Serebryany <kcc-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Alexander Potapenko
<glider-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Sasha Levin <sasha.levin-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
Eric Dumazet <edumazet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Greg Thelen <gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Subject: Re: WARNING in handle_mm_fault
Date: Tue, 24 Nov 2015 17:31:16 -0500 [thread overview]
Message-ID: <20151124223116.GA2874@cmpxchg.org> (raw)
In-Reply-To: <CACT4Y+ZCkv0BPOdo3aiheA5LXzXhcnuiw7kCoWL=b9FcC8-wqg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Hi Dmitry,
On Tue, Nov 24, 2015 at 02:50:26PM +0100, Dmitry Vyukov wrote:
> As a blind guess, I've added the following BUG into copy_process:
>
> diff --git a/kernel/fork.c b/kernel/fork.c
> index b4dc490..c5667e8 100644
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -1620,6 +1620,8 @@ static struct task_struct *copy_process(unsigned
> long clone_flags,
> trace_task_newtask(p, clone_flags);
> uprobe_copy_process(p, clone_flags);
>
> + BUG_ON(p->memcg_may_oom);
> +
> return p;
Thanks for your report.
I don't see how this could happen through the legitimate setters of
p->memcg_may_oom. Something must clobber it. What happens with the
following patch applied?
diff --git a/include/linux/sched.h b/include/linux/sched.h
index edad7a4..42e1285 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1463,9 +1463,11 @@ struct task_struct {
unsigned sched_reset_on_fork:1;
unsigned sched_contributes_to_load:1;
unsigned sched_migrated:1;
+ unsigned dummy_a:1;
#ifdef CONFIG_MEMCG
unsigned memcg_may_oom:1;
#endif
+ unsigned dummy_b:1;
#ifdef CONFIG_MEMCG_KMEM
unsigned memcg_kmem_skip_account:1;
#endif
diff --git a/kernel/fork.c b/kernel/fork.c
index f97f2c4..ab6f7ba 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1617,6 +1617,12 @@ static struct task_struct *copy_process(unsigned long clone_flags,
trace_task_newtask(p, clone_flags);
uprobe_copy_process(p, clone_flags);
+ if (p->dummy_a || p->dummy_b || p->memcg_may_oom) {
+ printk(KERN_ALERT "dummy_a:%d dummy_b:%d memcg_may_oom:%d\n",
+ p->dummy_a, p->dummy_b, p->memcg_may_oom);
+ BUG();
+ }
+
return p;
bad_fork_cancel_cgroup:
WARNING: multiple messages have this Message-ID (diff)
From: Johannes Weiner <hannes@cmpxchg.org>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: Michal Hocko <mhocko@kernel.org>,
cgroups@vger.kernel.org,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>,
syzkaller <syzkaller@googlegroups.com>,
Kostya Serebryany <kcc@google.com>,
Alexander Potapenko <glider@google.com>,
Sasha Levin <sasha.levin@oracle.com>,
Eric Dumazet <edumazet@google.com>,
Greg Thelen <gthelen@google.com>
Subject: Re: WARNING in handle_mm_fault
Date: Tue, 24 Nov 2015 17:31:16 -0500 [thread overview]
Message-ID: <20151124223116.GA2874@cmpxchg.org> (raw)
In-Reply-To: <CACT4Y+ZCkv0BPOdo3aiheA5LXzXhcnuiw7kCoWL=b9FcC8-wqg@mail.gmail.com>
Hi Dmitry,
On Tue, Nov 24, 2015 at 02:50:26PM +0100, Dmitry Vyukov wrote:
> As a blind guess, I've added the following BUG into copy_process:
>
> diff --git a/kernel/fork.c b/kernel/fork.c
> index b4dc490..c5667e8 100644
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -1620,6 +1620,8 @@ static struct task_struct *copy_process(unsigned
> long clone_flags,
> trace_task_newtask(p, clone_flags);
> uprobe_copy_process(p, clone_flags);
>
> + BUG_ON(p->memcg_may_oom);
> +
> return p;
Thanks for your report.
I don't see how this could happen through the legitimate setters of
p->memcg_may_oom. Something must clobber it. What happens with the
following patch applied?
diff --git a/include/linux/sched.h b/include/linux/sched.h
index edad7a4..42e1285 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1463,9 +1463,11 @@ struct task_struct {
unsigned sched_reset_on_fork:1;
unsigned sched_contributes_to_load:1;
unsigned sched_migrated:1;
+ unsigned dummy_a:1;
#ifdef CONFIG_MEMCG
unsigned memcg_may_oom:1;
#endif
+ unsigned dummy_b:1;
#ifdef CONFIG_MEMCG_KMEM
unsigned memcg_kmem_skip_account:1;
#endif
diff --git a/kernel/fork.c b/kernel/fork.c
index f97f2c4..ab6f7ba 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1617,6 +1617,12 @@ static struct task_struct *copy_process(unsigned long clone_flags,
trace_task_newtask(p, clone_flags);
uprobe_copy_process(p, clone_flags);
+ if (p->dummy_a || p->dummy_b || p->memcg_may_oom) {
+ printk(KERN_ALERT "dummy_a:%d dummy_b:%d memcg_may_oom:%d\n",
+ p->dummy_a, p->dummy_b, p->memcg_may_oom);
+ BUG();
+ }
+
return p;
bad_fork_cancel_cgroup:
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-11-24 22:31 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-24 13:50 WARNING in handle_mm_fault Dmitry Vyukov
[not found] ` <CACT4Y+ZCkv0BPOdo3aiheA5LXzXhcnuiw7kCoWL=b9FcC8-wqg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-11-24 22:31 ` Johannes Weiner [this message]
2015-11-24 22:31 ` Johannes Weiner
[not found] ` <20151124223116.GA2874-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2015-11-25 13:05 ` Dmitry Vyukov
2015-11-25 13:05 ` Dmitry Vyukov
2015-11-25 13:12 ` Dmitry Vyukov
2015-11-25 8:44 ` Michal Hocko
[not found] ` <20151125084403.GA24703-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2015-11-25 10:51 ` Tetsuo Handa
2015-11-25 10:51 ` Tetsuo Handa
2015-11-25 13:08 ` Dmitry Vyukov
[not found] ` <CACT4Y+Zn+mK37-mvqDQTyt1Psp6HT2heT0e937SO24F7V1q7PA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-11-25 15:27 ` Tetsuo Handa
2015-11-25 15:27 ` Tetsuo Handa
2015-11-25 17:21 ` Dmitry Vyukov
[not found] ` <CACT4Y+ZdF09hOnb_bL4GNjytSMMGvNde8=9pdZt6gZQB1sp0hQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-11-25 17:32 ` Dmitry Vyukov
2015-11-25 17:32 ` Dmitry Vyukov
2015-11-25 17:37 ` Michal Hocko
[not found] ` <20151125173730.GS27283-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2015-11-25 17:44 ` Dmitry Vyukov
2015-11-25 17:44 ` Dmitry Vyukov
[not found] ` <CACT4Y+Y0EESD_HhgGE2pWPqfJsDgvSny=ZMfP1ewaSzd6z_bLg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-11-26 11:33 ` Tetsuo Handa
2015-11-26 11:33 ` Tetsuo Handa
[not found] ` <201511262033.EAB48965.FVJOOOMLFHStFQ-JPay3/Yim36HaxMnTkn67Xf5DAMn2ifp@public.gmane.org>
2015-11-30 16:20 ` Peter Zijlstra
2015-11-30 16:20 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151124223116.GA2874@cmpxchg.org \
--to=hannes-druugvl0lcnafugrpc6u6w@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dvyukov-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=edumazet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=glider-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=kcc-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
--cc=mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sasha.levin-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
--cc=syzkaller-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.