Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-11-01 Thread Tetsuo Handa
Michal Hocko wrote: > > Does "that comment" refer to > > > > Elaborating the comment: the reason for the high wmark is to reduce > > the likelihood of livelocks and be sure to invoke the OOM killer, if > > we're still under pressure and reclaim just failed. The high wmark is > > used to

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-11-01 Thread Tetsuo Handa
Michal Hocko wrote: > > Does "that comment" refer to > > > > Elaborating the comment: the reason for the high wmark is to reduce > > the likelihood of livelocks and be sure to invoke the OOM killer, if > > we're still under pressure and reclaim just failed. The high wmark is > > used to

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-11-01 Thread Michal Hocko
On Wed 01-11-17 23:38:49, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Wed 01-11-17 20:58:50, Tetsuo Handa wrote: > > > > > But doing ALLOC_OOM for last second allocation attempt from > > > > > out_of_memory() involve > > > > > duplicating code (e.g. rebuilding zone list). > > > > > > > >

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-11-01 Thread Michal Hocko
On Wed 01-11-17 23:38:49, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Wed 01-11-17 20:58:50, Tetsuo Handa wrote: > > > > > But doing ALLOC_OOM for last second allocation attempt from > > > > > out_of_memory() involve > > > > > duplicating code (e.g. rebuilding zone list). > > > > > > > >

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-11-01 Thread Tetsuo Handa
Michal Hocko wrote: > On Wed 01-11-17 20:58:50, Tetsuo Handa wrote: > > > > But doing ALLOC_OOM for last second allocation attempt from > > > > out_of_memory() involve > > > > duplicating code (e.g. rebuilding zone list). > > > > > > Why would you do it? Do not blindly copy and paste code

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-11-01 Thread Tetsuo Handa
Michal Hocko wrote: > On Wed 01-11-17 20:58:50, Tetsuo Handa wrote: > > > > But doing ALLOC_OOM for last second allocation attempt from > > > > out_of_memory() involve > > > > duplicating code (e.g. rebuilding zone list). > > > > > > Why would you do it? Do not blindly copy and paste code

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-11-01 Thread Michal Hocko
On Wed 01-11-17 20:58:50, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Tue 31-10-17 22:51:49, Tetsuo Handa wrote: > > > Michal Hocko wrote: > > > > On Tue 31-10-17 22:13:05, Tetsuo Handa wrote: > > > > > Michal Hocko wrote: > > > > > > On Tue 31-10-17 21:42:23, Tetsuo Handa wrote: > > > > > >

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-11-01 Thread Michal Hocko
On Wed 01-11-17 20:58:50, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Tue 31-10-17 22:51:49, Tetsuo Handa wrote: > > > Michal Hocko wrote: > > > > On Tue 31-10-17 22:13:05, Tetsuo Handa wrote: > > > > > Michal Hocko wrote: > > > > > > On Tue 31-10-17 21:42:23, Tetsuo Handa wrote: > > > > > >

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-11-01 Thread Tetsuo Handa
Michal Hocko wrote: > On Tue 31-10-17 22:51:49, Tetsuo Handa wrote: > > Michal Hocko wrote: > > > On Tue 31-10-17 22:13:05, Tetsuo Handa wrote: > > > > Michal Hocko wrote: > > > > > On Tue 31-10-17 21:42:23, Tetsuo Handa wrote: > > > > > > > While both have some merit, the first reason is mostly

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-11-01 Thread Tetsuo Handa
Michal Hocko wrote: > On Tue 31-10-17 22:51:49, Tetsuo Handa wrote: > > Michal Hocko wrote: > > > On Tue 31-10-17 22:13:05, Tetsuo Handa wrote: > > > > Michal Hocko wrote: > > > > > On Tue 31-10-17 21:42:23, Tetsuo Handa wrote: > > > > > > > While both have some merit, the first reason is mostly

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-10-31 Thread Michal Hocko
On Tue 31-10-17 22:51:49, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Tue 31-10-17 22:13:05, Tetsuo Handa wrote: > > > Michal Hocko wrote: > > > > On Tue 31-10-17 21:42:23, Tetsuo Handa wrote: > > > > > > While both have some merit, the first reason is mostly historical > > > > > > because we

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-10-31 Thread Michal Hocko
On Tue 31-10-17 22:51:49, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Tue 31-10-17 22:13:05, Tetsuo Handa wrote: > > > Michal Hocko wrote: > > > > On Tue 31-10-17 21:42:23, Tetsuo Handa wrote: > > > > > > While both have some merit, the first reason is mostly historical > > > > > > because we

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-10-31 Thread Tetsuo Handa
Michal Hocko wrote: > On Tue 31-10-17 22:13:05, Tetsuo Handa wrote: > > Michal Hocko wrote: > > > On Tue 31-10-17 21:42:23, Tetsuo Handa wrote: > > > > > While both have some merit, the first reason is mostly historical > > > > > because we have the explicit locking now and it is really unlikely

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-10-31 Thread Tetsuo Handa
Michal Hocko wrote: > On Tue 31-10-17 22:13:05, Tetsuo Handa wrote: > > Michal Hocko wrote: > > > On Tue 31-10-17 21:42:23, Tetsuo Handa wrote: > > > > > While both have some merit, the first reason is mostly historical > > > > > because we have the explicit locking now and it is really unlikely

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-10-31 Thread Michal Hocko
On Tue 31-10-17 22:13:05, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Tue 31-10-17 21:42:23, Tetsuo Handa wrote: > > > > While both have some merit, the first reason is mostly historical > > > > because we have the explicit locking now and it is really unlikely that > > > > the memory would

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-10-31 Thread Michal Hocko
On Tue 31-10-17 22:13:05, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Tue 31-10-17 21:42:23, Tetsuo Handa wrote: > > > > While both have some merit, the first reason is mostly historical > > > > because we have the explicit locking now and it is really unlikely that > > > > the memory would

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-10-31 Thread Tetsuo Handa
Michal Hocko wrote: > On Tue 31-10-17 21:42:23, Tetsuo Handa wrote: > > > While both have some merit, the first reason is mostly historical > > > because we have the explicit locking now and it is really unlikely that > > > the memory would be available right after we have given up trying. > > >

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-10-31 Thread Tetsuo Handa
Michal Hocko wrote: > On Tue 31-10-17 21:42:23, Tetsuo Handa wrote: > > > While both have some merit, the first reason is mostly historical > > > because we have the explicit locking now and it is really unlikely that > > > the memory would be available right after we have given up trying. > > >

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-10-31 Thread Michal Hocko
On Tue 31-10-17 21:42:23, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Tue 31-10-17 19:40:09, Tetsuo Handa wrote: > > > The reason I used __alloc_pages_slowpath() in > > > alloc_pages_before_oomkill() is > > > to avoid duplicating code (such as checking for ALLOC_OOM and rebuilding > > >

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-10-31 Thread Michal Hocko
On Tue 31-10-17 21:42:23, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Tue 31-10-17 19:40:09, Tetsuo Handa wrote: > > > The reason I used __alloc_pages_slowpath() in > > > alloc_pages_before_oomkill() is > > > to avoid duplicating code (such as checking for ALLOC_OOM and rebuilding > > >

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-10-31 Thread Tetsuo Handa
Michal Hocko wrote: > On Tue 31-10-17 19:40:09, Tetsuo Handa wrote: > > The reason I used __alloc_pages_slowpath() in alloc_pages_before_oomkill() > > is > > to avoid duplicating code (such as checking for ALLOC_OOM and rebuilding > > zone > > list) which needs to be maintained in sync with

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-10-31 Thread Tetsuo Handa
Michal Hocko wrote: > On Tue 31-10-17 19:40:09, Tetsuo Handa wrote: > > The reason I used __alloc_pages_slowpath() in alloc_pages_before_oomkill() > > is > > to avoid duplicating code (such as checking for ALLOC_OOM and rebuilding > > zone > > list) which needs to be maintained in sync with

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-10-31 Thread Michal Hocko
On Tue 31-10-17 19:40:09, Tetsuo Handa wrote: > Michal Hocko wrote: > > > +struct page *alloc_pages_before_oomkill(struct oom_control *oc) > > > +{ > > > + /* > > > + * Make sure that this allocation attempt shall not depend on > > > + * __GFP_DIRECT_RECLAIM && !__GFP_NORETRY allocation, for the

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-10-31 Thread Michal Hocko
On Tue 31-10-17 19:40:09, Tetsuo Handa wrote: > Michal Hocko wrote: > > > +struct page *alloc_pages_before_oomkill(struct oom_control *oc) > > > +{ > > > + /* > > > + * Make sure that this allocation attempt shall not depend on > > > + * __GFP_DIRECT_RECLAIM && !__GFP_NORETRY allocation, for the

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-10-31 Thread Tetsuo Handa
Michal Hocko wrote: > > +struct page *alloc_pages_before_oomkill(struct oom_control *oc) > > +{ > > + /* > > +* Make sure that this allocation attempt shall not depend on > > +* __GFP_DIRECT_RECLAIM && !__GFP_NORETRY allocation, for the caller is > > +* already holding oom_lock. > >

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-10-31 Thread Tetsuo Handa
Michal Hocko wrote: > > +struct page *alloc_pages_before_oomkill(struct oom_control *oc) > > +{ > > + /* > > +* Make sure that this allocation attempt shall not depend on > > +* __GFP_DIRECT_RECLAIM && !__GFP_NORETRY allocation, for the caller is > > +* already holding oom_lock. > >

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-10-30 Thread Michal Hocko
On Sat 28-10-17 17:07:09, Tetsuo Handa wrote: > This patch splits last second allocation attempt into two locations, once > before selecting an OOM victim and again after selecting an OOM victim, > and uses normal watermark for last second allocation attempts. Why do we need both? > As of

Re: [PATCH] mm,oom: Try last second allocation before and after selecting an OOM victim.

2017-10-30 Thread Michal Hocko
On Sat 28-10-17 17:07:09, Tetsuo Handa wrote: > This patch splits last second allocation attempt into two locations, once > before selecting an OOM victim and again after selecting an OOM victim, > and uses normal watermark for last second allocation attempts. Why do we need both? > As of