diff for duplicates of <20190615134955.GA28441@dhcp22.suse.cz> diff --git a/a/1.txt b/N1/1.txt index 4d1a894..7090bf4 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,70 +1,85 @@ -On Fri 14-06-19 20:15:31, Shakeel Butt wrote: -> On Fri, Jun 14, 2019 at 6:08 PM syzbot -> <syzbot+d0fc9d3c166bc5e4a94b@syzkaller.appspotmail.com> wrote: -> > -> > Hello, -> > -> > syzbot found the following crash on: -> > -> > HEAD commit: 3f310e51 Add linux-next specific files for 20190607 -> > git tree: linux-next -> > console output: https://syzkaller.appspot.com/x/log.txt?x=15ab8771a00000 -> > kernel config: https://syzkaller.appspot.com/x/.config?x=5d176e1849bbc45 -> > dashboard link: https://syzkaller.appspot.com/bug?extid=d0fc9d3c166bc5e4a94b -> > compiler: gcc (GCC) 9.0.0 20181231 (experimental) -> > -> > Unfortunately, I don't have any reproducer for this crash yet. -> > -> > IMPORTANT: if you fix the bug, please add the following tag to the commit: -> > Reported-by: syzbot+d0fc9d3c166bc5e4a94b@syzkaller.appspotmail.com -> > -> > kasan: CONFIG_KASAN_INLINE enabled -> > kasan: GPF could be caused by NULL-ptr deref or user memory access -> > general protection fault: 0000 [#1] PREEMPT SMP KASAN -> > CPU: 0 PID: 28426 Comm: syz-executor.5 Not tainted 5.2.0-rc3-next-20190607 -> > #11 -> > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS -> > Google 01/01/2011 -> > RIP: 0010:__read_once_size include/linux/compiler.h:194 [inline] -> > RIP: 0010:has_intersects_mems_allowed mm/oom_kill.c:84 [inline] -> -> It seems like oom_unkillable_task() is broken for memcg OOMs. It -> should not be calling has_intersects_mems_allowed() for memcg OOMs. -You are right. It doesn't really make much sense to check for the NUMA -policy/cpusets when the memcg oom is NUMA agnostic. Now that I am -looking at the code then I am really wondering why do we even call -oom_unkillable_task from oom_badness. proc_oom_score shouldn't care -about NUMA either. +Hello Michal + +On Sat, 15 Jun 2019 13:49:57 +0000 (UTC) Michal Hocko wrote: +> On Fri 14-06-19 20:15:31, Shakeel Butt wrote: +> > On Fri, Jun 14, 2019 at 6:08 PM syzbot +> > <syzbot+d0fc9d3c166bc5e4a94b@syzkaller.appspotmail.com> wrote: +> > > +> > > Hello, +> > > +> > > syzbot found the following crash on: +> > > +> > > HEAD commit: 3f310e51 Add linux-next specific files for 20190607 +> > > git tree: linux-next +> > > console output: https://syzkaller.appspot.com/x/log.txt?x=15ab8771a00000 +> > > kernel config: https://syzkaller.appspot.com/x/.config?x=5d176e1849bbc45 +> > > dashboard link: https://syzkaller.appspot.com/bug?extid=d0fc9d3c166bc5e4a94b +> > > compiler: gcc (GCC) 9.0.0 20181231 (experimental) +> > > +> > > Unfortunately, I don't have any reproducer for this crash yet. +> > > +> > > IMPORTANT: if you fix the bug, please add the following tag to the commit: +> > > Reported-by: syzbot+d0fc9d3c166bc5e4a94b@syzkaller.appspotmail.com +> > > +> > > kasan: CONFIG_KASAN_INLINE enabled +> > > kasan: GPF could be caused by NULL-ptr deref or user memory access +> > > general protection fault: 0000 [#1] PREEMPT SMP KASAN +> > > CPU: 0 PID: 28426 Comm: syz-executor.5 Not tainted 5.2.0-rc3-next-20190607 +> > > #11 +> > > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS +> > > Google 01/01/2011 +> > > RIP: 0010:__read_once_size include/linux/compiler.h:194 [inline] +> > > RIP: 0010:has_intersects_mems_allowed mm/oom_kill.c:84 [inline] +> > +> > It seems like oom_unkillable_task() is broken for memcg OOMs. It +> > should not be calling has_intersects_mems_allowed() for memcg OOMs. +> +> You are right. It doesn't really make much sense to check for the NUMA +> policy/cpusets when the memcg oom is NUMA agnostic. Now that I am +> looking at the code then I am really wondering why do we even call +> oom_unkillable_task from oom_badness. proc_oom_score shouldn't care +> about NUMA either. +> +> In other words the following should fix this unless I am missing +> something (task_in_mem_cgroup seems to be a relict from before the group +> oom handling). But please note that I am still not fully operation and +> laying in the bed. +> +> diff --git a/mm/oom_kill.c b/mm/oom_kill.c +> index 5a58778c91d4..43eb479a5dc7 100644 +> --- a/mm/oom_kill.c +> +++ b/mm/oom_kill.c +> @@ -161,8 +161,8 @@ static bool oom_unkillable_task(struct task_struct *p, +> return true; +> +> /* When mem_cgroup_out_of_memory() and p is not member of the group */ +> - if (memcg && !task_in_mem_cgroup(p, memcg)) +> - return true; +> + if (memcg) +> + return false; +> +Given the members of the memcg: +1> tasks with flags having PF_EXITING set. +2> tasks without memory footprints on numa node-A-B. +3> tasks with memory footprint on numa node-A-B-C. -In other words the following should fix this unless I am missing -something (task_in_mem_cgroup seems to be a relict from before the group -oom handling). But please note that I am still not fully operation and -laying in the bed. +We'd try much to avoid killing 1> and 2> tasks imo to meet the current memory +allocation that only wants pages from node-A. -diff --git a/mm/oom_kill.c b/mm/oom_kill.c -index 5a58778c91d4..43eb479a5dc7 100644 ---- a/mm/oom_kill.c -+++ b/mm/oom_kill.c -@@ -161,8 +161,8 @@ static bool oom_unkillable_task(struct task_struct *p, - return true; - - /* When mem_cgroup_out_of_memory() and p is not member of the group */ -- if (memcg && !task_in_mem_cgroup(p, memcg)) -- return true; -+ if (memcg) -+ return false; - - /* p may not have freeable memory in nodemask */ - if (!has_intersects_mems_allowed(p, nodemask)) -@@ -318,7 +318,7 @@ static int oom_evaluate_task(struct task_struct *task, void *arg) - struct oom_control *oc = arg; - unsigned long points; - -- if (oom_unkillable_task(task, NULL, oc->nodemask)) -+ if (oom_unkillable_task(task, oc->memcg, oc->nodemask)) - goto next; - --- -Michal Hocko -SUSE Labs +-- +Hillf +> /* p may not have freeable memory in nodemask */ +> if (!has_intersects_mems_allowed(p, nodemask)) +> @@ -318,7 +318,7 @@ static int oom_evaluate_task(struct task_struct *task, void *arg) +> struct oom_control *oc = arg; +> unsigned long points; +> +> - if (oom_unkillable_task(task, NULL, oc->nodemask)) +> + if (oom_unkillable_task(task, oc->memcg, oc->nodemask)) +> goto next; +> +> -- +> Michal Hocko +> SUSE Labs +> diff --git a/a/content_digest b/N1/content_digest index 539ee93..6aeb54e 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,15 +1,15 @@ - "ref\00000000000004143a5058b526503@google.com\0" "ref\0CALvZod72=KuBZkSd0ey5orJFGFpwx462XY=cZvO3NOXC0MogFw@mail.gmail.com\0" - "From\0Michal Hocko <mhocko@kernel.org>\0" + "From\0Hillf Danton <hdanton@sina.com>\0" "Subject\0Re: general protection fault in oom_unkillable_task\0" - "Date\0Sat, 15 Jun 2019 15:49:55 +0200\0" - "To\0Shakeel Butt <shakeelb@google.com>\0" - "Cc\0syzbot <syzbot+d0fc9d3c166bc5e4a94b@syzkaller.appspotmail.com>" + "Date\0Sun, 16 Jun 2019 13:48:51 +0800\0" + "To\0Michal Hocko <mhocko@kernel.org>\0" + "Cc\0Shakeel Butt <shakeelb@google.com>" + syzbot <syzbot+d0fc9d3c166bc5e4a94b@syzkaller.appspotmail.com> Andrew Morton <akpm@linux-foundation.org> Eric W. Biederman <ebiederm@xmission.com> Roman Gushchin <guro@fb.com> Johannes Weiner <hannes@cmpxchg.org> - " J\303\251r\303\264me Glisse <jglisse@redhat.com>" + jglisse@redhat.com LKML <linux-kernel@vger.kernel.org> Linux MM <linux-mm@kvack.org> Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> @@ -17,75 +17,90 @@ " yuzhoujian@didichuxing.com\0" "\00:1\0" "b\0" - "On Fri 14-06-19 20:15:31, Shakeel Butt wrote:\n" - "> On Fri, Jun 14, 2019 at 6:08 PM syzbot\n" - "> <syzbot+d0fc9d3c166bc5e4a94b@syzkaller.appspotmail.com> wrote:\n" - "> >\n" - "> > Hello,\n" - "> >\n" - "> > syzbot found the following crash on:\n" - "> >\n" - "> > HEAD commit: 3f310e51 Add linux-next specific files for 20190607\n" - "> > git tree: linux-next\n" - "> > console output: https://syzkaller.appspot.com/x/log.txt?x=15ab8771a00000\n" - "> > kernel config: https://syzkaller.appspot.com/x/.config?x=5d176e1849bbc45\n" - "> > dashboard link: https://syzkaller.appspot.com/bug?extid=d0fc9d3c166bc5e4a94b\n" - "> > compiler: gcc (GCC) 9.0.0 20181231 (experimental)\n" - "> >\n" - "> > Unfortunately, I don't have any reproducer for this crash yet.\n" - "> >\n" - "> > IMPORTANT: if you fix the bug, please add the following tag to the commit:\n" - "> > Reported-by: syzbot+d0fc9d3c166bc5e4a94b@syzkaller.appspotmail.com\n" - "> >\n" - "> > kasan: CONFIG_KASAN_INLINE enabled\n" - "> > kasan: GPF could be caused by NULL-ptr deref or user memory access\n" - "> > general protection fault: 0000 [#1] PREEMPT SMP KASAN\n" - "> > CPU: 0 PID: 28426 Comm: syz-executor.5 Not tainted 5.2.0-rc3-next-20190607\n" - "> > #11\n" - "> > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS\n" - "> > Google 01/01/2011\n" - "> > RIP: 0010:__read_once_size include/linux/compiler.h:194 [inline]\n" - "> > RIP: 0010:has_intersects_mems_allowed mm/oom_kill.c:84 [inline]\n" - "> \n" - "> It seems like oom_unkillable_task() is broken for memcg OOMs. It\n" - "> should not be calling has_intersects_mems_allowed() for memcg OOMs.\n" "\n" - "You are right. It doesn't really make much sense to check for the NUMA\n" - "policy/cpusets when the memcg oom is NUMA agnostic. Now that I am\n" - "looking at the code then I am really wondering why do we even call\n" - "oom_unkillable_task from oom_badness. proc_oom_score shouldn't care\n" - "about NUMA either.\n" + "Hello Michal\n" + "\n" + "On Sat, 15 Jun 2019 13:49:57 +0000 (UTC) Michal Hocko wrote:\n" + "> On Fri 14-06-19 20:15:31, Shakeel Butt wrote:\n" + "> > On Fri, Jun 14, 2019 at 6:08 PM syzbot\n" + "> > <syzbot+d0fc9d3c166bc5e4a94b@syzkaller.appspotmail.com> wrote:\n" + "> > >\n" + "> > > Hello,\n" + "> > >\n" + "> > > syzbot found the following crash on:\n" + "> > >\n" + "> > > HEAD commit: 3f310e51 Add linux-next specific files for 20190607\n" + "> > > git tree: linux-next\n" + "> > > console output: https://syzkaller.appspot.com/x/log.txt?x=15ab8771a00000\n" + "> > > kernel config: https://syzkaller.appspot.com/x/.config?x=5d176e1849bbc45\n" + "> > > dashboard link: https://syzkaller.appspot.com/bug?extid=d0fc9d3c166bc5e4a94b\n" + "> > > compiler: gcc (GCC) 9.0.0 20181231 (experimental)\n" + "> > >\n" + "> > > Unfortunately, I don't have any reproducer for this crash yet.\n" + "> > >\n" + "> > > IMPORTANT: if you fix the bug, please add the following tag to the commit:\n" + "> > > Reported-by: syzbot+d0fc9d3c166bc5e4a94b@syzkaller.appspotmail.com\n" + "> > >\n" + "> > > kasan: CONFIG_KASAN_INLINE enabled\n" + "> > > kasan: GPF could be caused by NULL-ptr deref or user memory access\n" + "> > > general protection fault: 0000 [#1] PREEMPT SMP KASAN\n" + "> > > CPU: 0 PID: 28426 Comm: syz-executor.5 Not tainted 5.2.0-rc3-next-20190607\n" + "> > > #11\n" + "> > > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS\n" + "> > > Google 01/01/2011\n" + "> > > RIP: 0010:__read_once_size include/linux/compiler.h:194 [inline]\n" + "> > > RIP: 0010:has_intersects_mems_allowed mm/oom_kill.c:84 [inline]\n" + "> > \n" + "> > It seems like oom_unkillable_task() is broken for memcg OOMs. It\n" + "> > should not be calling has_intersects_mems_allowed() for memcg OOMs.\n" + "> \n" + "> You are right. It doesn't really make much sense to check for the NUMA\n" + "> policy/cpusets when the memcg oom is NUMA agnostic. Now that I am\n" + "> looking at the code then I am really wondering why do we even call\n" + "> oom_unkillable_task from oom_badness. proc_oom_score shouldn't care\n" + "> about NUMA either.\n" + "> \n" + "> In other words the following should fix this unless I am missing\n" + "> something (task_in_mem_cgroup seems to be a relict from before the group\n" + "> oom handling). But please note that I am still not fully operation and\n" + "> laying in the bed.\n" + "> \n" + "> diff --git a/mm/oom_kill.c b/mm/oom_kill.c\n" + "> index 5a58778c91d4..43eb479a5dc7 100644\n" + "> --- a/mm/oom_kill.c\n" + "> +++ b/mm/oom_kill.c\n" + "> @@ -161,8 +161,8 @@ static bool oom_unkillable_task(struct task_struct *p,\n" + "> \t\treturn true;\n" + "> \n" + "> \t/* When mem_cgroup_out_of_memory() and p is not member of the group */\n" + "> -\tif (memcg && !task_in_mem_cgroup(p, memcg))\n" + "> -\t\treturn true;\n" + "> +\tif (memcg)\n" + "> +\t\treturn false;\n" + ">\n" + "Given the members of the memcg:\n" + "1> tasks with flags having PF_EXITING set.\n" + "2> tasks without memory footprints on numa node-A-B.\n" + "3> tasks with memory footprint on numa node-A-B-C.\n" "\n" - "In other words the following should fix this unless I am missing\n" - "something (task_in_mem_cgroup seems to be a relict from before the group\n" - "oom handling). But please note that I am still not fully operation and\n" - "laying in the bed.\n" + "We'd try much to avoid killing 1> and 2> tasks imo to meet the current memory\n" + "allocation that only wants pages from node-A.\n" "\n" - "diff --git a/mm/oom_kill.c b/mm/oom_kill.c\n" - "index 5a58778c91d4..43eb479a5dc7 100644\n" - "--- a/mm/oom_kill.c\n" - "+++ b/mm/oom_kill.c\n" - "@@ -161,8 +161,8 @@ static bool oom_unkillable_task(struct task_struct *p,\n" - " \t\treturn true;\n" - " \n" - " \t/* When mem_cgroup_out_of_memory() and p is not member of the group */\n" - "-\tif (memcg && !task_in_mem_cgroup(p, memcg))\n" - "-\t\treturn true;\n" - "+\tif (memcg)\n" - "+\t\treturn false;\n" - " \n" - " \t/* p may not have freeable memory in nodemask */\n" - " \tif (!has_intersects_mems_allowed(p, nodemask))\n" - "@@ -318,7 +318,7 @@ static int oom_evaluate_task(struct task_struct *task, void *arg)\n" - " \tstruct oom_control *oc = arg;\n" - " \tunsigned long points;\n" - " \n" - "-\tif (oom_unkillable_task(task, NULL, oc->nodemask))\n" - "+\tif (oom_unkillable_task(task, oc->memcg, oc->nodemask))\n" - " \t\tgoto next;\n" - " \n" - "-- \n" - "Michal Hocko\n" - SUSE Labs + "--\n" + "Hillf\n" + "> \t/* p may not have freeable memory in nodemask */\n" + "> \tif (!has_intersects_mems_allowed(p, nodemask))\n" + "> @@ -318,7 +318,7 @@ static int oom_evaluate_task(struct task_struct *task, void *arg)\n" + "> \tstruct oom_control *oc = arg;\n" + "> \tunsigned long points;\n" + "> \n" + "> -\tif (oom_unkillable_task(task, NULL, oc->nodemask))\n" + "> +\tif (oom_unkillable_task(task, oc->memcg, oc->nodemask))\n" + "> \t\tgoto next;\n" + "> \n" + "> -- \n" + "> Michal Hocko\n" + "> SUSE Labs\n" + > -25062fd54c12070c0224934cfb4bbd7ba284f33aa491b71f3c5f7de41bc6d0e8 +23142e1367cad703e1e8cf8300c402d76133c4192894a913b20df4559c0772cf
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox