Re: Re: [PATCH] oom_reaper: close race without using oom_lock

2017-08-10 Thread Tetsuo Handa
Michal Hocko wrote: > On Thu 10-08-17 21:10:30, Tetsuo Handa wrote: > > Michal Hocko wrote: > > > On Tue 08-08-17 11:14:50, Tetsuo Handa wrote: > > > > Michal Hocko wrote: > > > > > On Sat 05-08-17 10:02:55, Tetsuo Handa wrote: > > > > > > Michal Hocko wrote: > > > > > > > On Wed 26-07-17

Re: Re: [PATCH] oom_reaper: close race without using oom_lock

2017-08-10 Thread Tetsuo Handa
Michal Hocko wrote: > On Thu 10-08-17 21:10:30, Tetsuo Handa wrote: > > Michal Hocko wrote: > > > On Tue 08-08-17 11:14:50, Tetsuo Handa wrote: > > > > Michal Hocko wrote: > > > > > On Sat 05-08-17 10:02:55, Tetsuo Handa wrote: > > > > > > Michal Hocko wrote: > > > > > > > On Wed 26-07-17

Re: Re: [PATCH] oom_reaper: close race without using oom_lock

2017-08-10 Thread Michal Hocko
On Thu 10-08-17 21:10:30, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Tue 08-08-17 11:14:50, Tetsuo Handa wrote: > > > Michal Hocko wrote: > > > > On Sat 05-08-17 10:02:55, Tetsuo Handa wrote: > > > > > Michal Hocko wrote: > > > > > > On Wed 26-07-17 20:33:21, Tetsuo Handa wrote: > > > > > >

Re: Re: [PATCH] oom_reaper: close race without using oom_lock

2017-08-10 Thread Michal Hocko
On Thu 10-08-17 21:10:30, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Tue 08-08-17 11:14:50, Tetsuo Handa wrote: > > > Michal Hocko wrote: > > > > On Sat 05-08-17 10:02:55, Tetsuo Handa wrote: > > > > > Michal Hocko wrote: > > > > > > On Wed 26-07-17 20:33:21, Tetsuo Handa wrote: > > > > > >

Re: Re: [PATCH] oom_reaper: close race without using oom_lock

2017-08-10 Thread Tetsuo Handa
Michal Hocko wrote: > On Tue 08-08-17 11:14:50, Tetsuo Handa wrote: > > Michal Hocko wrote: > > > On Sat 05-08-17 10:02:55, Tetsuo Handa wrote: > > > > Michal Hocko wrote: > > > > > On Wed 26-07-17 20:33:21, Tetsuo Handa wrote: > > > > > > My question is, how can users know it if somebody was

Re: Re: [PATCH] oom_reaper: close race without using oom_lock

2017-08-10 Thread Tetsuo Handa
Michal Hocko wrote: > On Tue 08-08-17 11:14:50, Tetsuo Handa wrote: > > Michal Hocko wrote: > > > On Sat 05-08-17 10:02:55, Tetsuo Handa wrote: > > > > Michal Hocko wrote: > > > > > On Wed 26-07-17 20:33:21, Tetsuo Handa wrote: > > > > > > My question is, how can users know it if somebody was

Re: Re: [PATCH] oom_reaper: close race without using oom_lock

2017-08-10 Thread Michal Hocko
On Tue 08-08-17 11:14:50, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Sat 05-08-17 10:02:55, Tetsuo Handa wrote: > > > Michal Hocko wrote: > > > > On Wed 26-07-17 20:33:21, Tetsuo Handa wrote: > > > > > Michal Hocko wrote: > > > > > > On Sun 23-07-17 09:41:50, Tetsuo Handa wrote: > > > > > >

Re: Re: [PATCH] oom_reaper: close race without using oom_lock

2017-08-10 Thread Michal Hocko
On Tue 08-08-17 11:14:50, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Sat 05-08-17 10:02:55, Tetsuo Handa wrote: > > > Michal Hocko wrote: > > > > On Wed 26-07-17 20:33:21, Tetsuo Handa wrote: > > > > > Michal Hocko wrote: > > > > > > On Sun 23-07-17 09:41:50, Tetsuo Handa wrote: > > > > > >

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-08-07 Thread Michal Hocko
On Sat 05-08-17 10:02:55, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Wed 26-07-17 20:33:21, Tetsuo Handa wrote: > > > Michal Hocko wrote: > > > > On Sun 23-07-17 09:41:50, Tetsuo Handa wrote: > > > > > So, how can we verify the above race a real problem? > > > > > > > > Try to simulate a

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-08-07 Thread Michal Hocko
On Sat 05-08-17 10:02:55, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Wed 26-07-17 20:33:21, Tetsuo Handa wrote: > > > Michal Hocko wrote: > > > > On Sun 23-07-17 09:41:50, Tetsuo Handa wrote: > > > > > So, how can we verify the above race a real problem? > > > > > > > > Try to simulate a

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-08-04 Thread Tetsuo Handa
Michal Hocko wrote: > On Wed 26-07-17 20:33:21, Tetsuo Handa wrote: > > Michal Hocko wrote: > > > On Sun 23-07-17 09:41:50, Tetsuo Handa wrote: > > > > So, how can we verify the above race a real problem? > > > > > > Try to simulate a _real_ workload and see whether we kill more tasks > > > than

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-08-04 Thread Tetsuo Handa
Michal Hocko wrote: > On Wed 26-07-17 20:33:21, Tetsuo Handa wrote: > > Michal Hocko wrote: > > > On Sun 23-07-17 09:41:50, Tetsuo Handa wrote: > > > > So, how can we verify the above race a real problem? > > > > > > Try to simulate a _real_ workload and see whether we kill more tasks > > > than

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-26 Thread Michal Hocko
On Wed 26-07-17 20:33:21, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Sun 23-07-17 09:41:50, Tetsuo Handa wrote: > > > So, how can we verify the above race a real problem? > > > > Try to simulate a _real_ workload and see whether we kill more tasks > > than necessary. > > Whether it is a

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-26 Thread Michal Hocko
On Wed 26-07-17 20:33:21, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Sun 23-07-17 09:41:50, Tetsuo Handa wrote: > > > So, how can we verify the above race a real problem? > > > > Try to simulate a _real_ workload and see whether we kill more tasks > > than necessary. > > Whether it is a

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-26 Thread Tetsuo Handa
Michal Hocko wrote: > On Sun 23-07-17 09:41:50, Tetsuo Handa wrote: > > So, how can we verify the above race a real problem? > > Try to simulate a _real_ workload and see whether we kill more tasks > than necessary. Whether it is a _real_ workload or not cannot become an answer. If somebody is

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-26 Thread Tetsuo Handa
Michal Hocko wrote: > On Sun 23-07-17 09:41:50, Tetsuo Handa wrote: > > So, how can we verify the above race a real problem? > > Try to simulate a _real_ workload and see whether we kill more tasks > than necessary. Whether it is a _real_ workload or not cannot become an answer. If somebody is

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-24 Thread Michal Hocko
On Sun 23-07-17 09:41:50, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Sat 22-07-17 00:18:48, Tetsuo Handa wrote: > > > Michal Hocko wrote: > > > > OK, so let's say you have another task just about to jump into > > > > out_of_memory and ... end up in the same situation. > > > > > > Right. > >

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-24 Thread Michal Hocko
On Sun 23-07-17 09:41:50, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Sat 22-07-17 00:18:48, Tetsuo Handa wrote: > > > Michal Hocko wrote: > > > > OK, so let's say you have another task just about to jump into > > > > out_of_memory and ... end up in the same situation. > > > > > > Right. > >

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-22 Thread Tetsuo Handa
Tetsuo Handa wrote: > Log is at http://I-love.SAKURA.ne.jp/tmp/serial-20170722.txt.xz . Oops, I forgot to remove mmput_async() in Patch2. Below is updated result. Though, situation (i.e. we can't tell without Patch1 whether we raced with OOM_MMF_SKIP) is same. Patch1:

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-22 Thread Tetsuo Handa
Tetsuo Handa wrote: > Log is at http://I-love.SAKURA.ne.jp/tmp/serial-20170722.txt.xz . Oops, I forgot to remove mmput_async() in Patch2. Below is updated result. Though, situation (i.e. we can't tell without Patch1 whether we raced with OOM_MMF_SKIP) is same. Patch1:

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-22 Thread Tetsuo Handa
Michal Hocko wrote: > On Sat 22-07-17 00:18:48, Tetsuo Handa wrote: > > Michal Hocko wrote: > > > OK, so let's say you have another task just about to jump into > > > out_of_memory and ... end up in the same situation. > > > > Right. > > > > > > > >

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-22 Thread Tetsuo Handa
Michal Hocko wrote: > On Sat 22-07-17 00:18:48, Tetsuo Handa wrote: > > Michal Hocko wrote: > > > OK, so let's say you have another task just about to jump into > > > out_of_memory and ... end up in the same situation. > > > > Right. > > > > > > > >

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-21 Thread Michal Hocko
On Sat 22-07-17 00:18:48, Tetsuo Handa wrote: > Michal Hocko wrote: > > > If we ignore MMF_OOM_SKIP once, we can avoid sequence above. > > > > But we set MMF_OOM_SKIP _after_ the process lost its address space (well > > after the patch which allows to race oom reaper with the exit_mmap). > > > >

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-21 Thread Michal Hocko
On Sat 22-07-17 00:18:48, Tetsuo Handa wrote: > Michal Hocko wrote: > > > If we ignore MMF_OOM_SKIP once, we can avoid sequence above. > > > > But we set MMF_OOM_SKIP _after_ the process lost its address space (well > > after the patch which allows to race oom reaper with the exit_mmap). > > > >

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-21 Thread Tetsuo Handa
Michal Hocko wrote: > > If we ignore MMF_OOM_SKIP once, we can avoid sequence above. > > But we set MMF_OOM_SKIP _after_ the process lost its address space (well > after the patch which allows to race oom reaper with the exit_mmap). > > > > > Process-1 Process-2 > > > >

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-21 Thread Tetsuo Handa
Michal Hocko wrote: > > If we ignore MMF_OOM_SKIP once, we can avoid sequence above. > > But we set MMF_OOM_SKIP _after_ the process lost its address space (well > after the patch which allows to race oom reaper with the exit_mmap). > > > > > Process-1 Process-2 > > > >

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-21 Thread Michal Hocko
On Fri 21-07-17 06:47:11, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Wed 19-07-17 05:51:03, Tetsuo Handa wrote: > > > Michal Hocko wrote: > > > > On Tue 18-07-17 23:06:50, Tetsuo Handa wrote: > > > > > Commit e2fe14564d3316d1 ("oom_reaper: close race with exiting task") > > > > > guarded

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-21 Thread Michal Hocko
On Fri 21-07-17 06:47:11, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Wed 19-07-17 05:51:03, Tetsuo Handa wrote: > > > Michal Hocko wrote: > > > > On Tue 18-07-17 23:06:50, Tetsuo Handa wrote: > > > > > Commit e2fe14564d3316d1 ("oom_reaper: close race with exiting task") > > > > > guarded

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-20 Thread Tetsuo Handa
Michal Hocko wrote: > On Wed 19-07-17 05:51:03, Tetsuo Handa wrote: > > Michal Hocko wrote: > > > On Tue 18-07-17 23:06:50, Tetsuo Handa wrote: > > > > Commit e2fe14564d3316d1 ("oom_reaper: close race with exiting task") > > > > guarded whole OOM reaping operations using oom_lock. But there was no

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-20 Thread Tetsuo Handa
Michal Hocko wrote: > On Wed 19-07-17 05:51:03, Tetsuo Handa wrote: > > Michal Hocko wrote: > > > On Tue 18-07-17 23:06:50, Tetsuo Handa wrote: > > > > Commit e2fe14564d3316d1 ("oom_reaper: close race with exiting task") > > > > guarded whole OOM reaping operations using oom_lock. But there was no

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-20 Thread Michal Hocko
On Wed 19-07-17 05:51:03, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Tue 18-07-17 23:06:50, Tetsuo Handa wrote: > > > Commit e2fe14564d3316d1 ("oom_reaper: close race with exiting task") > > > guarded whole OOM reaping operations using oom_lock. But there was no > > > need to guard whole

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-20 Thread Michal Hocko
On Wed 19-07-17 05:51:03, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Tue 18-07-17 23:06:50, Tetsuo Handa wrote: > > > Commit e2fe14564d3316d1 ("oom_reaper: close race with exiting task") > > > guarded whole OOM reaping operations using oom_lock. But there was no > > > need to guard whole

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-18 Thread Tetsuo Handa
Michal Hocko wrote: > On Tue 18-07-17 23:06:50, Tetsuo Handa wrote: > > Commit e2fe14564d3316d1 ("oom_reaper: close race with exiting task") > > guarded whole OOM reaping operations using oom_lock. But there was no > > need to guard whole operations. We needed to guard only setting of > >

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-18 Thread Tetsuo Handa
Michal Hocko wrote: > On Tue 18-07-17 23:06:50, Tetsuo Handa wrote: > > Commit e2fe14564d3316d1 ("oom_reaper: close race with exiting task") > > guarded whole OOM reaping operations using oom_lock. But there was no > > need to guard whole operations. We needed to guard only setting of > >

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-18 Thread Johannes Weiner
On Tue, Jul 18, 2017 at 11:06:50PM +0900, Tetsuo Handa wrote: > Commit e2fe14564d3316d1 ("oom_reaper: close race with exiting task") > guarded whole OOM reaping operations using oom_lock. But there was no > need to guard whole operations. We needed to guard only setting of > MMF_OOM_REAPED flag

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-18 Thread Johannes Weiner
On Tue, Jul 18, 2017 at 11:06:50PM +0900, Tetsuo Handa wrote: > Commit e2fe14564d3316d1 ("oom_reaper: close race with exiting task") > guarded whole OOM reaping operations using oom_lock. But there was no > need to guard whole operations. We needed to guard only setting of > MMF_OOM_REAPED flag

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-18 Thread Michal Hocko
On Tue 18-07-17 23:06:50, Tetsuo Handa wrote: > Commit e2fe14564d3316d1 ("oom_reaper: close race with exiting task") > guarded whole OOM reaping operations using oom_lock. But there was no > need to guard whole operations. We needed to guard only setting of > MMF_OOM_REAPED flag because

Re: [PATCH] oom_reaper: close race without using oom_lock

2017-07-18 Thread Michal Hocko
On Tue 18-07-17 23:06:50, Tetsuo Handa wrote: > Commit e2fe14564d3316d1 ("oom_reaper: close race with exiting task") > guarded whole OOM reaping operations using oom_lock. But there was no > need to guard whole operations. We needed to guard only setting of > MMF_OOM_REAPED flag because