lkml.org 
[lkml]   [2016]   [Feb]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm: memcontrol: reset memory.low on css offline
On Mon 29-02-16 20:16:33, Vladimir Davydov wrote:
> When a cgroup directory is removed, the memory cgroup subsys state does
> not disappear immediately. Instead, it's left hanging around until the
> last reference to it is gone, which implies reclaiming all pages from
> its lruvec.
>
> In the unified hierarchy, there's the memory.low knob, which can be used
> to set a best-effort protection for a memory cgroup - the reclaimer
> first scans those cgroups whose consumption is above memory.low, and
> only if it fails to reclaim enough pages, it gets to the rest.
>
> Currently this protection is not reset when the cgroup directory is
> removed. As a result, if a dead memory cgroup has a lot of page cache
> charged to it and a high value of memory.low, it will result in higher
> pressure exerted on live cgroups, and userspace will have no ways to
> detect such consumers and reconfigure memory.low properly.
>
> To fix this, let's reset memory.low on css offline.

Makes sense to me

> Signed-off-by: Vladimir Davydov <vdavydov@virtuozzo.com>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
> mm/memcontrol.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index ae8b81c55685..ab7bfe870c7d 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -4214,6 +4214,8 @@ static void mem_cgroup_css_offline(struct cgroup_subsys_state *css)
>
> memcg_offline_kmem(memcg);
> wb_memcg_offline(memcg);
> +
> + memcg->low = 0;
> }
>
> static void mem_cgroup_css_released(struct cgroup_subsys_state *css)
> --
> 2.1.4

--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2016-02-29 20:01    [W:0.046 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site