lkml.org 
[lkml]   [2020]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC PATCH] mm: memcg/slab: Stop reparented obj_cgroups from charging root
Date
Hello,

Richard Palethorpe <rpalethorpe@suse.de> writes:

> Hello Roman,
>
> Roman Gushchin <guro@fb.com> writes:
>
>> - page_counter_init(&memcg->memory, NULL);
>> - page_counter_init(&memcg->swap, NULL);
>> - page_counter_init(&memcg->kmem, NULL);
>> - page_counter_init(&memcg->tcpmem, NULL);
>> + /*
>> + * If use_hierarchy == false, consider all page counters direct
>> + * descendants of the corresponding root level counters.
>> + */
>> + page_counter_init(&memcg->memory, &root_mem_cgroup->memory);
>> + page_counter_init(&memcg->swap, &root_mem_cgroup->swap);
>> + page_counter_init(&memcg->kmem, &root_mem_cgroup->kmem);
>> + page_counter_init(&memcg->tcpmem, &root_mem_cgroup->tcpmem);
>> +
>> /*
>> * Deeper hierachy with use_hierarchy == false doesn't make
>> * much sense so let cgroup subsystem know about this
>
> Perhaps in this case, where the hierarchy is broken, objcgs should also
> be reparented directly to root? Otherwise it will still be possible to
> underflow the counter in a descendant of root which has use_hierarchy=0,
> but also has children.

Sorry ignore me, parent_mem_cgroup already selects root. So in the case
of a broken hierarchy objcgs are reparented directly to root.

--
Thank you,
Richard.

\
 
 \ /
  Last update: 2020-10-20 14:03    [W:0.128 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site