[PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-04-03 Thread Michal Hocko
From: Michal Hocko David has noticed that THP memcg charge can trigger the oom killer since 2516035499b9 ("mm, thp: remove __GFP_NORETRY from khugepaged and madvised allocations"). We have used an explicit __GFP_NORETRY previously which ruled the OOM killer automagically. Memcg

[PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-04-03 Thread Michal Hocko
From: Michal Hocko David has noticed that THP memcg charge can trigger the oom killer since 2516035499b9 ("mm, thp: remove __GFP_NORETRY from khugepaged and madvised allocations"). We have used an explicit __GFP_NORETRY previously which ruled the OOM killer automagically. Memcg charge path

Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-04-03 Thread Johannes Weiner
mcg. > > > > Acked-by: Johannes Weiner <han...@cmpxchg.org> > > I will repost the patch with the currently merged THP specific handling > reverted (see below). While 9d3c3354bb85 might have been an appropriate > quick fix, we shouldn't keep it longterm for 4.17+ IMHO. &g

Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-04-03 Thread Johannes Weiner
the patch with the currently merged THP specific handling > reverted (see below). While 9d3c3354bb85 might have been an appropriate > quick fix, we shouldn't keep it longterm for 4.17+ IMHO. > > Does you ack apply to that patch as well? Yep, looks good to me. > From: Michal Hocko >

Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-04-03 Thread Michal Hocko
te quick fix, we shouldn't keep it longterm for 4.17+ IMHO. Does you ack apply to that patch as well? --- >From 3e1b127dd6107a0e51654e90d9faef7f196f5a10 Mon Sep 17 00:00:00 2001 From: Michal Hocko <mho...@suse.com> Date: Wed, 21 Mar 2018 10:10:37 +0100 Subject: [PATCH] memcg, thp: do not in

Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-04-03 Thread Michal Hocko
s well? --- >From 3e1b127dd6107a0e51654e90d9faef7f196f5a10 Mon Sep 17 00:00:00 2001 From: Michal Hocko Date: Wed, 21 Mar 2018 10:10:37 +0100 Subject: [PATCH] memcg, thp: do not invoke oom killer on thp charges David has noticed that THP memcg charge can trigger the oom killer since 2516035499b

Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-04-03 Thread Johannes Weiner
On Wed, Mar 21, 2018 at 09:59:28PM +0100, Michal Hocko wrote: > From: Michal Hocko > > David has noticed that THP memcg charge can trigger the oom killer > since 2516035499b9 ("mm, thp: remove __GFP_NORETRY from khugepaged and > madvised allocations"). We have used an explicit

Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-04-03 Thread Johannes Weiner
On Wed, Mar 21, 2018 at 09:59:28PM +0100, Michal Hocko wrote: > From: Michal Hocko > > David has noticed that THP memcg charge can trigger the oom killer > since 2516035499b9 ("mm, thp: remove __GFP_NORETRY from khugepaged and > madvised allocations"). We have used an explicit __GFP_NORETRY >

Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-04-03 Thread Johannes Weiner
On Wed, Mar 21, 2018 at 02:22:13PM -0700, David Rientjes wrote: > PAGE_ALLOC_COSTLY_ORDER is a heuristic used by the page allocator because > it cannot free high-order contiguous memory. Memcg just needs to reclaim > a number of pages. Two order-3 charges can cause a memcg oom kill but now >

Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-04-03 Thread Johannes Weiner
On Wed, Mar 21, 2018 at 02:22:13PM -0700, David Rientjes wrote: > PAGE_ALLOC_COSTLY_ORDER is a heuristic used by the page allocator because > it cannot free high-order contiguous memory. Memcg just needs to reclaim > a number of pages. Two order-3 charges can cause a memcg oom kill but now >

Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-03-23 Thread David Rientjes
On Fri, 23 Mar 2018, Michal Hocko wrote: > > Examples of where this isn't already done? It certainly wasn't a problem > > before __GFP_NORETRY was dropped in commit 2516035499b9 but you suspect > > it's a problem now. > > It is not a problem _right now_ as I've already pointed out few >

Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-03-23 Thread David Rientjes
On Fri, 23 Mar 2018, Michal Hocko wrote: > > Examples of where this isn't already done? It certainly wasn't a problem > > before __GFP_NORETRY was dropped in commit 2516035499b9 but you suspect > > it's a problem now. > > It is not a problem _right now_ as I've already pointed out few >

Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-03-23 Thread Michal Hocko
On Thu 22-03-18 13:29:37, David Rientjes wrote: > On Thu, 22 Mar 2018, Michal Hocko wrote: [...] > > They simply cannot because kmalloc performs the change under the cover. > > So you would have to use kmalloc(gfp|__GFP_NORETRY) to be absolutely > > sure to not trigger _any_ oom killer. This is

Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-03-23 Thread Michal Hocko
On Thu 22-03-18 13:29:37, David Rientjes wrote: > On Thu, 22 Mar 2018, Michal Hocko wrote: [...] > > They simply cannot because kmalloc performs the change under the cover. > > So you would have to use kmalloc(gfp|__GFP_NORETRY) to be absolutely > > sure to not trigger _any_ oom killer. This is

Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-03-22 Thread David Rientjes
On Thu, 22 Mar 2018, Michal Hocko wrote: > > So now you're making a generalized policy change to the memcg charge path > > to fix what is obviously only thp and caused by removing the __GFP_NORETRY > > from thp allocations in commit 2516035499b9? > > Yes, because relying on __GFP_NORETRY for

Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-03-22 Thread David Rientjes
On Thu, 22 Mar 2018, Michal Hocko wrote: > > So now you're making a generalized policy change to the memcg charge path > > to fix what is obviously only thp and caused by removing the __GFP_NORETRY > > from thp allocations in commit 2516035499b9? > > Yes, because relying on __GFP_NORETRY for

Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-03-22 Thread Michal Hocko
On Thu 22-03-18 01:26:13, David Rientjes wrote: > On Wed, 21 Mar 2018, Michal Hocko wrote: > > > > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > > > > index d1a917b5b7b7..08accbcd1a18 100644 > > > > --- a/mm/memcontrol.c > > > > +++ b/mm/memcontrol.c > > > > @@ -1493,7 +1493,7 @@ static void

Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-03-22 Thread Michal Hocko
On Thu 22-03-18 01:26:13, David Rientjes wrote: > On Wed, 21 Mar 2018, Michal Hocko wrote: > > > > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > > > > index d1a917b5b7b7..08accbcd1a18 100644 > > > > --- a/mm/memcontrol.c > > > > +++ b/mm/memcontrol.c > > > > @@ -1493,7 +1493,7 @@ static void

Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-03-22 Thread David Rientjes
On Wed, 21 Mar 2018, Michal Hocko wrote: > > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > > > index d1a917b5b7b7..08accbcd1a18 100644 > > > --- a/mm/memcontrol.c > > > +++ b/mm/memcontrol.c > > > @@ -1493,7 +1493,7 @@ static void memcg_oom_recover(struct mem_cgroup > > > *memcg) > > > >

Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-03-22 Thread David Rientjes
On Wed, 21 Mar 2018, Michal Hocko wrote: > > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > > > index d1a917b5b7b7..08accbcd1a18 100644 > > > --- a/mm/memcontrol.c > > > +++ b/mm/memcontrol.c > > > @@ -1493,7 +1493,7 @@ static void memcg_oom_recover(struct mem_cgroup > > > *memcg) > > > >

Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-03-21 Thread Michal Hocko
On Wed 21-03-18 14:22:13, David Rientjes wrote: > On Wed, 21 Mar 2018, Michal Hocko wrote: > > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > > index d1a917b5b7b7..08accbcd1a18 100644 > > --- a/mm/memcontrol.c > > +++ b/mm/memcontrol.c > > @@ -1493,7 +1493,7 @@ static void

Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-03-21 Thread Michal Hocko
On Wed 21-03-18 14:22:13, David Rientjes wrote: > On Wed, 21 Mar 2018, Michal Hocko wrote: > > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > > index d1a917b5b7b7..08accbcd1a18 100644 > > --- a/mm/memcontrol.c > > +++ b/mm/memcontrol.c > > @@ -1493,7 +1493,7 @@ static void

Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-03-21 Thread David Rientjes
On Wed, 21 Mar 2018, Michal Hocko wrote: > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index d1a917b5b7b7..08accbcd1a18 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -1493,7 +1493,7 @@ static void memcg_oom_recover(struct mem_cgroup *memcg) > > static void

Re: [PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-03-21 Thread David Rientjes
On Wed, 21 Mar 2018, Michal Hocko wrote: > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index d1a917b5b7b7..08accbcd1a18 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -1493,7 +1493,7 @@ static void memcg_oom_recover(struct mem_cgroup *memcg) > > static void

[PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-03-21 Thread Michal Hocko
From: Michal Hocko David has noticed that THP memcg charge can trigger the oom killer since 2516035499b9 ("mm, thp: remove __GFP_NORETRY from khugepaged and madvised allocations"). We have used an explicit __GFP_NORETRY previously which ruled the OOM killer automagically. Memcg

[PATCH] memcg, thp: do not invoke oom killer on thp charges

2018-03-21 Thread Michal Hocko
From: Michal Hocko David has noticed that THP memcg charge can trigger the oom killer since 2516035499b9 ("mm, thp: remove __GFP_NORETRY from khugepaged and madvised allocations"). We have used an explicit __GFP_NORETRY previously which ruled the OOM killer automagically. Memcg charge path