Re: [PATCH v3] mm: memcg/slab: Stop reparented obj_cgroups from charging root

2020-10-22 Thread Richard Palethorpe
Hello, Michal Koutný writes: > Hi. > > On Tue, Oct 20, 2020 at 06:52:08AM +0100, Richard Palethorpe > wrote: >> I don't think that is relevant as we get the memcg from objcg->memcg >> which is set during reparenting. I suppose however, we can determine if >> the objcg was reparented by

Re: [PATCH v3] mm: memcg/slab: Stop reparented obj_cgroups from charging root

2020-10-21 Thread Roman Gushchin
On Tue, Oct 20, 2020 at 09:56:51AM -0700, Shakeel Butt wrote: > On Tue, Oct 20, 2020 at 6:49 AM Richard Palethorpe > wrote: > > > > Hello, > > > > Richard Palethorpe writes: > > > > > Hello Shakeel, > > > > > > Shakeel Butt writes: > > >>> > > >>> V3: Handle common case where use_hierarchy=1

Re: [PATCH v3] mm: memcg/slab: Stop reparented obj_cgroups from charging root

2020-10-20 Thread Michal Koutný
Hi. On Tue, Oct 20, 2020 at 06:52:08AM +0100, Richard Palethorpe wrote: > I don't think that is relevant as we get the memcg from objcg->memcg > which is set during reparenting. I suppose however, we can determine if > the objcg was reparented by inspecting memcg->objcg. +1 > If we just check

Re: [PATCH v3] mm: memcg/slab: Stop reparented obj_cgroups from charging root

2020-10-20 Thread Shakeel Butt
On Tue, Oct 20, 2020 at 6:49 AM Richard Palethorpe wrote: > > Hello, > > Richard Palethorpe writes: > > > Hello Shakeel, > > > > Shakeel Butt writes: > >>> > >>> V3: Handle common case where use_hierarchy=1 and update description. > >>> > >>> mm/memcontrol.c | 7 +-- > >>> 1 file changed,

Re: [PATCH v3] mm: memcg/slab: Stop reparented obj_cgroups from charging root

2020-10-20 Thread Richard Palethorpe
Hello, Richard Palethorpe writes: > Hello Shakeel, > > Shakeel Butt writes: >>> >>> V3: Handle common case where use_hierarchy=1 and update description. >>> >>> mm/memcontrol.c | 7 +-- >>> 1 file changed, 5 insertions(+), 2 deletions(-) >>> >>> diff --git a/mm/memcontrol.c

Re: [PATCH v3] mm: memcg/slab: Stop reparented obj_cgroups from charging root

2020-10-19 Thread Richard Palethorpe
Hello Shakeel, Shakeel Butt writes: >> >> V3: Handle common case where use_hierarchy=1 and update description. >> >> mm/memcontrol.c | 7 +-- >> 1 file changed, 5 insertions(+), 2 deletions(-) >> >> diff --git a/mm/memcontrol.c b/mm/memcontrol.c >> index 6877c765b8d0..34b8c4a66853 100644 >>

Re: [PATCH v3] mm: memcg/slab: Stop reparented obj_cgroups from charging root

2020-10-19 Thread Shakeel Butt
On Mon, Oct 19, 2020 at 2:59 AM Richard Palethorpe wrote: > > SLAB objects which outlive their descendant memcg are moved to their > parent memcg where they may be uncharged. However if they are moved to > the root memcg and use_hierarchy=0, uncharging will result in negative > page counter

[PATCH v3] mm: memcg/slab: Stop reparented obj_cgroups from charging root

2020-10-19 Thread Richard Palethorpe
SLAB objects which outlive their descendant memcg are moved to their parent memcg where they may be uncharged. However if they are moved to the root memcg and use_hierarchy=0, uncharging will result in negative page counter values. This is because when use_hierarchy=0, the root memcg's page