Re: Possible race condition in oom-killer

2017-08-01 Thread Michal Hocko
On Tue 01-08-17 23:16:13, Tetsuo Handa wrote: > Michal Hocko wrote: > > Once we merge [1] then the oom victim wouldn't > > need to get TIF_MEMDIE to access memory reserves. > > > > [1] http://lkml.kernel.org/r/20170727090357.3205-2-mho...@kernel.org > > False. We are not

Re: Possible race condition in oom-killer

2017-08-01 Thread Michal Hocko
On Tue 01-08-17 23:16:13, Tetsuo Handa wrote: > Michal Hocko wrote: > > Once we merge [1] then the oom victim wouldn't > > need to get TIF_MEMDIE to access memory reserves. > > > > [1] http://lkml.kernel.org/r/20170727090357.3205-2-mho...@kernel.org > > False. We are not

Re: Possible race condition in oom-killer

2017-08-01 Thread Tetsuo Handa
Michal Hocko wrote: > Once we merge [1] then the oom victim wouldn't > need to get TIF_MEMDIE to access memory reserves. > > [1] http://lkml.kernel.org/r/20170727090357.3205-2-mho...@kernel.org False. We are not setting oom_mm to all thread groups (!CLONE_THREAD) sharing

Re: Possible race condition in oom-killer

2017-08-01 Thread Tetsuo Handa
Michal Hocko wrote: > Once we merge [1] then the oom victim wouldn't > need to get TIF_MEMDIE to access memory reserves. > > [1] http://lkml.kernel.org/r/20170727090357.3205-2-mho...@kernel.org False. We are not setting oom_mm to all thread groups (!CLONE_THREAD) sharing

Re: Possible race condition in oom-killer

2017-08-01 Thread Michal Hocko
On Sat 29-07-17 13:31:44, Tetsuo Handa wrote: [...] > @@ -806,6 +799,20 @@ static bool task_will_free_mem(struct task_struct *task) > } > rcu_read_unlock(); > > + /* > + * It is possible that current thread fails to try allocation from > + * memory reserves if the OOM

Re: Possible race condition in oom-killer

2017-08-01 Thread Michal Hocko
On Sat 29-07-17 13:31:44, Tetsuo Handa wrote: [...] > @@ -806,6 +799,20 @@ static bool task_will_free_mem(struct task_struct *task) > } > rcu_read_unlock(); > > + /* > + * It is possible that current thread fails to try allocation from > + * memory reserves if the OOM

Re: Possible race condition in oom-killer

2017-08-01 Thread Michal Hocko
On Tue 01-08-17 19:46:38, Tetsuo Handa wrote: > Michal Hocko wrote: > > > > Is > > > > something other than the LTP test affected to give this more priority? > > > > Do we have other usecases where something mlocks the whole memory?

Re: Possible race condition in oom-killer

2017-08-01 Thread Michal Hocko
On Tue 01-08-17 19:46:38, Tetsuo Handa wrote: > Michal Hocko wrote: > > > > Is > > > > something other than the LTP test affected to give this more priority? > > > > Do we have other usecases where something mlocks the whole memory?

Re: Possible race condition in oom-killer

2017-08-01 Thread Tetsuo Handa
Michal Hocko wrote: > > > Is > > > something other than the LTP test affected to give this more priority? > > > Do we have other usecases where something mlocks the whole memory? > > > > This panic was caused by 50 threads sharing

Re: Possible race condition in oom-killer

2017-08-01 Thread Tetsuo Handa
Michal Hocko wrote: > > > Is > > > something other than the LTP test affected to give this more priority? > > > Do we have other usecases where something mlocks the whole memory? > > > > This panic was caused by 50 threads sharing

Re: Possible race condition in oom-killer

2017-07-28 Thread Tetsuo Handa
Michal Hocko wrote: > On Fri 28-07-17 22:55:51, Tetsuo Handa wrote: > > Michal Hocko wrote: > > > On Fri 28-07-17 22:15:01, Tetsuo Handa wrote: > > > > task_will_free_mem(current) in out_of_memory() returning false due to > > > > MMF_OOM_SKIP already set allowed each thread sharing that mm to

Re: Possible race condition in oom-killer

2017-07-28 Thread Tetsuo Handa
Michal Hocko wrote: > On Fri 28-07-17 22:55:51, Tetsuo Handa wrote: > > Michal Hocko wrote: > > > On Fri 28-07-17 22:15:01, Tetsuo Handa wrote: > > > > task_will_free_mem(current) in out_of_memory() returning false due to > > > > MMF_OOM_SKIP already set allowed each thread sharing that mm to

Re: Possible race condition in oom-killer

2017-07-28 Thread Michal Hocko
On Fri 28-07-17 19:20:42, Manish Jaggi wrote: > > Hi Michal, > On 7/28/2017 6:02 PM, Michal Hocko wrote: > >[CC linux-mm] > > > >On Fri 28-07-17 17:22:25, Manish Jaggi wrote: > >>was: Re: [PATCH] mm, oom: allow oom reaper to race with exit_mmap > >> > >>Hi Michal, > >>On 7/27/2017 2:54 PM, Michal

Re: Possible race condition in oom-killer

2017-07-28 Thread Michal Hocko
On Fri 28-07-17 19:20:42, Manish Jaggi wrote: > > Hi Michal, > On 7/28/2017 6:02 PM, Michal Hocko wrote: > >[CC linux-mm] > > > >On Fri 28-07-17 17:22:25, Manish Jaggi wrote: > >>was: Re: [PATCH] mm, oom: allow oom reaper to race with exit_mmap > >> > >>Hi Michal, > >>On 7/27/2017 2:54 PM, Michal

Re: Possible race condition in oom-killer

2017-07-28 Thread Michal Hocko
On Fri 28-07-17 22:55:51, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Fri 28-07-17 22:15:01, Tetsuo Handa wrote: > > > task_will_free_mem(current) in out_of_memory() returning false due to > > > MMF_OOM_SKIP already set allowed each thread sharing that mm to select a > > > new > > > OOM

Re: Possible race condition in oom-killer

2017-07-28 Thread Michal Hocko
On Fri 28-07-17 22:55:51, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Fri 28-07-17 22:15:01, Tetsuo Handa wrote: > > > task_will_free_mem(current) in out_of_memory() returning false due to > > > MMF_OOM_SKIP already set allowed each thread sharing that mm to select a > > > new > > > OOM

Re: Possible race condition in oom-killer

2017-07-28 Thread Tetsuo Handa
Michal Hocko wrote: > On Fri 28-07-17 22:15:01, Tetsuo Handa wrote: > > task_will_free_mem(current) in out_of_memory() returning false due to > > MMF_OOM_SKIP already set allowed each thread sharing that mm to select a new > > OOM victim. If task_will_free_mem(current) in out_of_memory() did not

Re: Possible race condition in oom-killer

2017-07-28 Thread Tetsuo Handa
Michal Hocko wrote: > On Fri 28-07-17 22:15:01, Tetsuo Handa wrote: > > task_will_free_mem(current) in out_of_memory() returning false due to > > MMF_OOM_SKIP already set allowed each thread sharing that mm to select a new > > OOM victim. If task_will_free_mem(current) in out_of_memory() did not

Re: Possible race condition in oom-killer

2017-07-28 Thread Manish Jaggi
Hi Michal, On 7/28/2017 6:02 PM, Michal Hocko wrote: [CC linux-mm] On Fri 28-07-17 17:22:25, Manish Jaggi wrote: was: Re: [PATCH] mm, oom: allow oom reaper to race with exit_mmap Hi Michal, On 7/27/2017 2:54 PM, Michal Hocko wrote: On Thu 27-07-17 13:59:09, Manish Jaggi wrote: [...] With

Re: Possible race condition in oom-killer

2017-07-28 Thread Manish Jaggi
Hi Michal, On 7/28/2017 6:02 PM, Michal Hocko wrote: [CC linux-mm] On Fri 28-07-17 17:22:25, Manish Jaggi wrote: was: Re: [PATCH] mm, oom: allow oom reaper to race with exit_mmap Hi Michal, On 7/27/2017 2:54 PM, Michal Hocko wrote: On Thu 27-07-17 13:59:09, Manish Jaggi wrote: [...] With

Re: Possible race condition in oom-killer

2017-07-28 Thread Michal Hocko
On Fri 28-07-17 22:15:01, Tetsuo Handa wrote: > Michal Hocko wrote: > > > 4578 is consuming memory as mlocked pages. But the OOM reaper cannot > > > reclaim > > > mlocked pages (i.e. can_madv_dontneed_vma() returns false due to > > > VM_LOCKED), can it? > > > > You are absolutely right. I am

Re: Possible race condition in oom-killer

2017-07-28 Thread Michal Hocko
On Fri 28-07-17 22:15:01, Tetsuo Handa wrote: > Michal Hocko wrote: > > > 4578 is consuming memory as mlocked pages. But the OOM reaper cannot > > > reclaim > > > mlocked pages (i.e. can_madv_dontneed_vma() returns false due to > > > VM_LOCKED), can it? > > > > You are absolutely right. I am

Re: Possible race condition in oom-killer

2017-07-28 Thread Manish Jaggi
Hello Tetsuo Handa, On 7/28/2017 6:29 PM, Tetsuo Handa wrote: (Oops. Forgot to add CC.) On 2017/07/28 21:32, Michal Hocko wrote: [CC linux-mm] On Fri 28-07-17 17:22:25, Manish Jaggi wrote: was: Re: [PATCH] mm, oom: allow oom reaper to race with exit_mmap Hi Michal, On 7/27/2017 2:54 PM,

Re: Possible race condition in oom-killer

2017-07-28 Thread Manish Jaggi
Hello Tetsuo Handa, On 7/28/2017 6:29 PM, Tetsuo Handa wrote: (Oops. Forgot to add CC.) On 2017/07/28 21:32, Michal Hocko wrote: [CC linux-mm] On Fri 28-07-17 17:22:25, Manish Jaggi wrote: was: Re: [PATCH] mm, oom: allow oom reaper to race with exit_mmap Hi Michal, On 7/27/2017 2:54 PM,

Re: Possible race condition in oom-killer

2017-07-28 Thread Tetsuo Handa
Michal Hocko wrote: > > 4578 is consuming memory as mlocked pages. But the OOM reaper cannot reclaim > > mlocked pages (i.e. can_madv_dontneed_vma() returns false due to > > VM_LOCKED), can it? > > You are absolutely right. I am pretty sure I've checked mlocked counter > as the first thing but

Re: Possible race condition in oom-killer

2017-07-28 Thread Tetsuo Handa
Michal Hocko wrote: > > 4578 is consuming memory as mlocked pages. But the OOM reaper cannot reclaim > > mlocked pages (i.e. can_madv_dontneed_vma() returns false due to > > VM_LOCKED), can it? > > You are absolutely right. I am pretty sure I've checked mlocked counter > as the first thing but

Re: Possible race condition in oom-killer

2017-07-28 Thread Michal Hocko
On Fri 28-07-17 21:59:50, Tetsuo Handa wrote: > (Oops. Forgot to add CC.) > > On 2017/07/28 21:32, Michal Hocko wrote: > > [CC linux-mm] > > > > On Fri 28-07-17 17:22:25, Manish Jaggi wrote: > >> was: Re: [PATCH] mm, oom: allow oom reaper to race with exit_mmap > >> > >> Hi Michal, > >> On

Re: Possible race condition in oom-killer

2017-07-28 Thread Michal Hocko
On Fri 28-07-17 21:59:50, Tetsuo Handa wrote: > (Oops. Forgot to add CC.) > > On 2017/07/28 21:32, Michal Hocko wrote: > > [CC linux-mm] > > > > On Fri 28-07-17 17:22:25, Manish Jaggi wrote: > >> was: Re: [PATCH] mm, oom: allow oom reaper to race with exit_mmap > >> > >> Hi Michal, > >> On

Re: Possible race condition in oom-killer

2017-07-28 Thread Tetsuo Handa
(Oops. Forgot to add CC.) On 2017/07/28 21:32, Michal Hocko wrote: > [CC linux-mm] > > On Fri 28-07-17 17:22:25, Manish Jaggi wrote: >> was: Re: [PATCH] mm, oom: allow oom reaper to race with exit_mmap >> >> Hi Michal, >> On 7/27/2017 2:54 PM, Michal Hocko wrote: >>> On Thu 27-07-17 13:59:09,

Re: Possible race condition in oom-killer

2017-07-28 Thread Tetsuo Handa
(Oops. Forgot to add CC.) On 2017/07/28 21:32, Michal Hocko wrote: > [CC linux-mm] > > On Fri 28-07-17 17:22:25, Manish Jaggi wrote: >> was: Re: [PATCH] mm, oom: allow oom reaper to race with exit_mmap >> >> Hi Michal, >> On 7/27/2017 2:54 PM, Michal Hocko wrote: >>> On Thu 27-07-17 13:59:09,

Re: Possible race condition in oom-killer

2017-07-28 Thread Michal Hocko
[CC linux-mm] On Fri 28-07-17 17:22:25, Manish Jaggi wrote: > was: Re: [PATCH] mm, oom: allow oom reaper to race with exit_mmap > > Hi Michal, > On 7/27/2017 2:54 PM, Michal Hocko wrote: > >On Thu 27-07-17 13:59:09, Manish Jaggi wrote: > >[...] > >>With 4.11.6 I was getting random kernel panics

Re: Possible race condition in oom-killer

2017-07-28 Thread Michal Hocko
[CC linux-mm] On Fri 28-07-17 17:22:25, Manish Jaggi wrote: > was: Re: [PATCH] mm, oom: allow oom reaper to race with exit_mmap > > Hi Michal, > On 7/27/2017 2:54 PM, Michal Hocko wrote: > >On Thu 27-07-17 13:59:09, Manish Jaggi wrote: > >[...] > >>With 4.11.6 I was getting random kernel panics

Possible race condition in oom-killer

2017-07-28 Thread Manish Jaggi
was: Re: [PATCH] mm, oom: allow oom reaper to race with exit_mmap Hi Michal, On 7/27/2017 2:54 PM, Michal Hocko wrote: On Thu 27-07-17 13:59:09, Manish Jaggi wrote: [...] With 4.11.6 I was getting random kernel panics (Out of memory - No process left to kill), when running LTP oom01 /oom02

Possible race condition in oom-killer

2017-07-28 Thread Manish Jaggi
was: Re: [PATCH] mm, oom: allow oom reaper to race with exit_mmap Hi Michal, On 7/27/2017 2:54 PM, Michal Hocko wrote: On Thu 27-07-17 13:59:09, Manish Jaggi wrote: [...] With 4.11.6 I was getting random kernel panics (Out of memory - No process left to kill), when running LTP oom01 /oom02