Re: [PATCH] mm: oom: Fix race condition between oom_badness and do_exit of task

2018-03-13 Thread Michal Hocko
[Sorry about the slow response but I was offline for almost two weeks and catching up with a tsunami in my inbox now] On Fri 09-03-18 19:48:46, Tetsuo Handa wrote: > Kohli, Gaurav wrote: > > > t->alloc_lock is still held when leaving find_lock_task_mm(), which means > > > that t->mm != NULL. But

Re: [PATCH] mm: oom: Fix race condition between oom_badness and do_exit of task

2018-03-13 Thread Michal Hocko
[Sorry about the slow response but I was offline for almost two weeks and catching up with a tsunami in my inbox now] On Fri 09-03-18 19:48:46, Tetsuo Handa wrote: > Kohli, Gaurav wrote: > > > t->alloc_lock is still held when leaving find_lock_task_mm(), which means > > > that t->mm != NULL. But

Re: [PATCH] mm: oom: Fix race condition between oom_badness and do_exit of task

2018-03-09 Thread Tetsuo Handa
Kohli, Gaurav wrote: > On 3/9/2018 4:18 PM, Tetsuo Handa wrote: > > > Kohli, Gaurav wrote: > >>> t->alloc_lock is still held when leaving find_lock_task_mm(), which means > >>> that t->mm != NULL. But nothing prevents t from setting t->mm = NULL at > >>> exit_mm() from do_exit() and calling

Re: [PATCH] mm: oom: Fix race condition between oom_badness and do_exit of task

2018-03-09 Thread Tetsuo Handa
Kohli, Gaurav wrote: > On 3/9/2018 4:18 PM, Tetsuo Handa wrote: > > > Kohli, Gaurav wrote: > >>> t->alloc_lock is still held when leaving find_lock_task_mm(), which means > >>> that t->mm != NULL. But nothing prevents t from setting t->mm = NULL at > >>> exit_mm() from do_exit() and calling

Re: [PATCH] mm: oom: Fix race condition between oom_badness and do_exit of task

2018-03-09 Thread Kohli, Gaurav
On 3/9/2018 4:18 PM, Tetsuo Handa wrote: Kohli, Gaurav wrote: t->alloc_lock is still held when leaving find_lock_task_mm(), which means that t->mm != NULL. But nothing prevents t from setting t->mm = NULL at exit_mm() from do_exit() and calling exit_creds() from __put_task_struct(t) after

Re: [PATCH] mm: oom: Fix race condition between oom_badness and do_exit of task

2018-03-09 Thread Kohli, Gaurav
On 3/9/2018 4:18 PM, Tetsuo Handa wrote: Kohli, Gaurav wrote: t->alloc_lock is still held when leaving find_lock_task_mm(), which means that t->mm != NULL. But nothing prevents t from setting t->mm = NULL at exit_mm() from do_exit() and calling exit_creds() from __put_task_struct(t) after

Re: [PATCH] mm: oom: Fix race condition between oom_badness and do_exit of task

2018-03-09 Thread Tetsuo Handa
Kohli, Gaurav wrote: > > t->alloc_lock is still held when leaving find_lock_task_mm(), which means > > that t->mm != NULL. But nothing prevents t from setting t->mm = NULL at > > exit_mm() from do_exit() and calling exit_creds() from __put_task_struct(t) > > after task_unlock(t) is called. Seems

Re: [PATCH] mm: oom: Fix race condition between oom_badness and do_exit of task

2018-03-09 Thread Tetsuo Handa
Kohli, Gaurav wrote: > > t->alloc_lock is still held when leaving find_lock_task_mm(), which means > > that t->mm != NULL. But nothing prevents t from setting t->mm = NULL at > > exit_mm() from do_exit() and calling exit_creds() from __put_task_struct(t) > > after task_unlock(t) is called. Seems

Re: [PATCH] mm: oom: Fix race condition between oom_badness and do_exit of task

2018-03-08 Thread Tetsuo Handa
On 2018/03/08 13:51, Kohli, Gaurav wrote: > On 3/8/2018 2:26 AM, David Rientjes wrote: > >> On Wed, 7 Mar 2018, Gaurav Kohli wrote: >> >>> diff --git a/mm/oom_kill.c b/mm/oom_kill.c >>> index 6fd9773..5f4cc4b 100644 >>> --- a/mm/oom_kill.c >>> +++ b/mm/oom_kill.c >>> @@ -114,9 +114,11 @@ struct

Re: [PATCH] mm: oom: Fix race condition between oom_badness and do_exit of task

2018-03-08 Thread Tetsuo Handa
On 2018/03/08 13:51, Kohli, Gaurav wrote: > On 3/8/2018 2:26 AM, David Rientjes wrote: > >> On Wed, 7 Mar 2018, Gaurav Kohli wrote: >> >>> diff --git a/mm/oom_kill.c b/mm/oom_kill.c >>> index 6fd9773..5f4cc4b 100644 >>> --- a/mm/oom_kill.c >>> +++ b/mm/oom_kill.c >>> @@ -114,9 +114,11 @@ struct

Re: [PATCH] mm: oom: Fix race condition between oom_badness and do_exit of task

2018-03-07 Thread Kohli, Gaurav
On 3/8/2018 2:26 AM, David Rientjes wrote: On Wed, 7 Mar 2018, Gaurav Kohli wrote: diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 6fd9773..5f4cc4b 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -114,9 +114,11 @@ struct task_struct *find_lock_task_mm(struct task_struct *p)

Re: [PATCH] mm: oom: Fix race condition between oom_badness and do_exit of task

2018-03-07 Thread Kohli, Gaurav
On 3/8/2018 2:26 AM, David Rientjes wrote: On Wed, 7 Mar 2018, Gaurav Kohli wrote: diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 6fd9773..5f4cc4b 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -114,9 +114,11 @@ struct task_struct *find_lock_task_mm(struct task_struct *p)

Re: [PATCH] mm: oom: Fix race condition between oom_badness and do_exit of task

2018-03-07 Thread David Rientjes
On Wed, 7 Mar 2018, Gaurav Kohli wrote: > diff --git a/mm/oom_kill.c b/mm/oom_kill.c > index 6fd9773..5f4cc4b 100644 > --- a/mm/oom_kill.c > +++ b/mm/oom_kill.c > @@ -114,9 +114,11 @@ struct task_struct *find_lock_task_mm(struct task_struct > *p) > > for_each_thread(p, t) { >

Re: [PATCH] mm: oom: Fix race condition between oom_badness and do_exit of task

2018-03-07 Thread David Rientjes
On Wed, 7 Mar 2018, Gaurav Kohli wrote: > diff --git a/mm/oom_kill.c b/mm/oom_kill.c > index 6fd9773..5f4cc4b 100644 > --- a/mm/oom_kill.c > +++ b/mm/oom_kill.c > @@ -114,9 +114,11 @@ struct task_struct *find_lock_task_mm(struct task_struct > *p) > > for_each_thread(p, t) { >