Re: [patch v2] mm, oom: fix concurrent munlock and oom reaperunmap

2018-04-24 Thread Michal Hocko
On Tue 24-04-18 17:08:15, Michal Hocko wrote: > On Tue 24-04-18 14:07:52, David Rientjes wrote: > > On Tue, 24 Apr 2018, Michal Hocko wrote: > > > > > > > > My patch has passed intensive testing on both x86 and powerpc, so > > > > > > I'll ask > > > > > > that it's pushed for 4.17-rc3. Many tha

Re: [patch v2] mm, oom: fix concurrent munlock and oom reaperunmap

2018-04-24 Thread Michal Hocko
On Tue 24-04-18 14:07:52, David Rientjes wrote: > On Tue, 24 Apr 2018, Michal Hocko wrote: > > > > > > My patch has passed intensive testing on both x86 and powerpc, so > > > > > I'll ask > > > > > that it's pushed for 4.17-rc3. Many thanks to Tetsuo for the > > > > > suggestion > > > > > on

Re: [patch v2] mm, oom: fix concurrent munlock and oom reaperunmap

2018-04-24 Thread David Rientjes
On Tue, 24 Apr 2018, Michal Hocko wrote: > > > > My patch has passed intensive testing on both x86 and powerpc, so I'll > > > > ask > > > > that it's pushed for 4.17-rc3. Many thanks to Tetsuo for the > > > > suggestion > > > > on calling __oom_reap_task_mm() from exit_mmap(). > > > > > > Ye

Re: [patch v2] mm, oom: fix concurrent munlock and oom reaperunmap

2018-04-24 Thread Michal Hocko
On Tue 24-04-18 13:22:45, David Rientjes wrote: [...] > > > My patch has passed intensive testing on both x86 and powerpc, so I'll > > > ask > > > that it's pushed for 4.17-rc3. Many thanks to Tetsuo for the suggestion > > > on calling __oom_reap_task_mm() from exit_mmap(). > > > > Yeah, but y

Re: [patch v2] mm, oom: fix concurrent munlock and oom reaperunmap

2018-04-24 Thread David Rientjes
On Tue, 24 Apr 2018, Michal Hocko wrote: > > I wanted to remove all per task checks because they are now irrelevant: > > this would be the first dependency that exit_mmap() has on any > > task_struct, which isn't intuitive -- we simply want to exit the mmap. > > There's no requirement that cur

Re: [patch v2] mm, oom: fix concurrent munlock and oom reaperunmap

2018-04-24 Thread Michal Hocko
On Tue 24-04-18 13:01:03, David Rientjes wrote: > On Tue, 24 Apr 2018, Michal Hocko wrote: > > > Is there any reason why we cannot simply call __oom_reap_task_mm as we > > have it now? mmap_sem for read shouldn't fail here because this is the > > last reference of the mm and we are past the ksm an

Re: [patch v2] mm, oom: fix concurrent munlock and oom reaperunmap

2018-04-24 Thread David Rientjes
On Tue, 24 Apr 2018, Michal Hocko wrote: > Is there any reason why we cannot simply call __oom_reap_task_mm as we > have it now? mmap_sem for read shouldn't fail here because this is the > last reference of the mm and we are past the ksm and khugepaged > synchronizations. So unless my jed laged br

Re: [patch v2] mm, oom: fix concurrent munlock and oom reaperunmap

2018-04-24 Thread Michal Hocko
On Mon 23-04-18 19:31:05, David Rientjes wrote: [...] > diff --git a/mm/mmap.c b/mm/mmap.c > --- a/mm/mmap.c > +++ b/mm/mmap.c > @@ -3015,6 +3015,27 @@ void exit_mmap(struct mm_struct *mm) > /* mm's last user has gone, and its about to be pulled down */ > mmu_notifier_release(mm); > >

Re: [patch v2] mm, oom: fix concurrent munlock and oom reaperunmap

2018-04-23 Thread David Rientjes
On Tue, 24 Apr 2018, Tetsuo Handa wrote: > > > We can call __oom_reap_task_mm() from exit_mmap() (or __mmput()) before > > > exit_mmap() holds mmap_sem for write. Then, at least memory which could > > > have been reclaimed if exit_mmap() did not hold mmap_sem for write will > > > be guaranteed to

Re: [patch v2] mm, oom: fix concurrent munlock and oom reaperunmap

2018-04-23 Thread Tetsuo Handa
> On Sun, 22 Apr 2018, Tetsuo Handa wrote: > > > > I'm wondering why you do not see oom killing of many processes if the > > > victim is a very large process that takes a long time to free memory in > > > exit_mmap() as I do because the oom reaper gives up trying to acquire > > > mm->mmap_sem a

Re: [patch v2] mm, oom: fix concurrent munlock and oom reaperunmap

2018-04-23 Thread David Rientjes
On Sun, 22 Apr 2018, Tetsuo Handa wrote: > > I'm wondering why you do not see oom killing of many processes if the > > victim is a very large process that takes a long time to free memory in > > exit_mmap() as I do because the oom reaper gives up trying to acquire > > mm->mmap_sem and just sets

Re: [patch v2] mm, oom: fix concurrent munlock and oom reaperunmap

2018-04-22 Thread Michal Hocko
On Sun 22-04-18 12:48:13, Tetsuo Handa wrote: > David Rientjes wrote: > > How have you tested this? > > > > I'm wondering why you do not see oom killing of many processes if the > > victim is a very large process that takes a long time to free memory in > > exit_mmap() as I do because the oom re

Re: [patch v2] mm, oom: fix concurrent munlock and oom reaperunmap

2018-04-21 Thread Tetsuo Handa
David Rientjes wrote: > How have you tested this? > > I'm wondering why you do not see oom killing of many processes if the > victim is a very large process that takes a long time to free memory in > exit_mmap() as I do because the oom reaper gives up trying to acquire > mm->mmap_sem and just s