Re: [v3 1/6] mm, oom: use oom_victims counter to synchronize oom victim selection

2017-06-29 Thread Tetsuo Handa
Roman Gushchin wrote: > On Fri, Jun 23, 2017 at 06:52:20AM +0900, Tetsuo Handa wrote: > > Tetsuo Handa wrote: > > Oops, I misinterpreted. This is where a multithreaded OOM victim with or > > without > > the OOM reaper can get stuck forever. Think about a process with two > > threads is > >

Re: [v3 1/6] mm, oom: use oom_victims counter to synchronize oom victim selection

2017-06-29 Thread Roman Gushchin
On Fri, Jun 23, 2017 at 06:52:20AM +0900, Tetsuo Handa wrote: > Tetsuo Handa wrote: > > Roman Gushchin wrote: > > > On Thu, Jun 22, 2017 at 09:40:28AM +0900, Tetsuo Handa wrote: > > > > Roman Gushchin wrote: > > > > > --- a/mm/oom_kill.c > > > > > +++ b/mm/oom_kill.c > > > > > @@ -992,6 +992,13 @@

Re: [v3 1/6] mm, oom: use oom_victims counter to synchronize oom victim selection

2017-06-29 Thread Michal Hocko
On Wed 21-06-17 22:19:11, Roman Gushchin wrote: > Oom killer should avoid unnecessary kills. To prevent them, during > the tasks list traverse we check for task which was previously > selected as oom victims. If there is such a task, new victim > is not selected. > > This approach is sub-optimal

Re: [v3 1/6] mm, oom: use oom_victims counter to synchronize oom victim selection

2017-06-22 Thread Tetsuo Handa
Tetsuo Handa wrote: > Roman Gushchin wrote: > > On Thu, Jun 22, 2017 at 09:40:28AM +0900, Tetsuo Handa wrote: > > > Roman Gushchin wrote: > > > > --- a/mm/oom_kill.c > > > > +++ b/mm/oom_kill.c > > > > @@ -992,6 +992,13 @@ bool out_of_memory(struct oom_control *oc) > > > > if

Re: [v3 1/6] mm, oom: use oom_victims counter to synchronize oom victim selection

2017-06-22 Thread Tetsuo Handa
Roman Gushchin wrote: > On Thu, Jun 22, 2017 at 09:40:28AM +0900, Tetsuo Handa wrote: > > Roman Gushchin wrote: > > > --- a/mm/oom_kill.c > > > +++ b/mm/oom_kill.c > > > @@ -992,6 +992,13 @@ bool out_of_memory(struct oom_control *oc) > > > if (oom_killer_disabled) > > > return false; >

Re: [v3 1/6] mm, oom: use oom_victims counter to synchronize oom victim selection

2017-06-22 Thread Roman Gushchin
On Thu, Jun 22, 2017 at 09:40:28AM +0900, Tetsuo Handa wrote: > Roman Gushchin wrote: > > --- a/mm/oom_kill.c > > +++ b/mm/oom_kill.c > > @@ -992,6 +992,13 @@ bool out_of_memory(struct oom_control *oc) > > if (oom_killer_disabled) > > return false; > > > > + /* > > +* If

[v3 1/6] mm, oom: use oom_victims counter to synchronize oom victim selection

2017-06-21 Thread Roman Gushchin
Oom killer should avoid unnecessary kills. To prevent them, during the tasks list traverse we check for task which was previously selected as oom victims. If there is such a task, new victim is not selected. This approach is sub-optimal (we're doing costly iteration over the task list every time)