Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1606118 > unrolled thread

[PATCH] mm: workingset: fix premature shadow node shrinking with cgroups

Started byJohannes Weiner <hannes@cmpxchg.org>
First post2017-03-22 02:00 +0100
Last post2017-03-23 09:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] mm: workingset: fix premature shadow node shrinking with cgroups Johannes Weiner <hannes@cmpxchg.org> - 2017-03-22 02:00 +0100
    Re: [PATCH] mm: workingset: fix premature shadow node shrinking with  cgroups Vladimir Davydov <vdavydov@tarantool.org> - 2017-03-23 09:50 +0100

#1606118 — [PATCH] mm: workingset: fix premature shadow node shrinking with cgroups

FromJohannes Weiner <hannes@cmpxchg.org>
Date2017-03-22 02:00 +0100
Subject[PATCH] mm: workingset: fix premature shadow node shrinking with cgroups
Message-ID<tnCN4-2HJ-3@gated-at.bofh.it>
0a6b76dd23fa ("mm: workingset: make shadow node shrinker memcg aware")
enabled cgroup-awareness in the shadow node shrinker, but forgot to
also enable cgroup-awareness in the list_lru the shadow nodes sit on.

Consequently, all shadow nodes are sitting on a global (per-NUMA node)
list, while the shrinker applies the limits according to the amount of
cache in the cgroup its shrinking. The result is excessive pressure on
the shadow nodes from cgroups that have very little cache.

Enable memcg-mode on the shadow node LRUs, such that per-cgroup limits
are applied to per-cgroup lists.

Fixes: 0a6b76dd23fa ("mm: workingset: make shadow node shrinker memcg aware")
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: <stable@vger.kernel.org> # 4.6+
---
 mm/workingset.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/workingset.c b/mm/workingset.c
index ac839fca0e76..eda05c71fa49 100644
--- a/mm/workingset.c
+++ b/mm/workingset.c
@@ -532,7 +532,7 @@ static int __init workingset_init(void)
 	pr_info("workingset: timestamp_bits=%d max_order=%d bucket_order=%u\n",
 	       timestamp_bits, max_order, bucket_order);
 
-	ret = list_lru_init_key(&shadow_nodes, &shadow_nodes_key);
+	ret = __list_lru_init(&shadow_nodes, true, &shadow_nodes_key);
 	if (ret)
 		goto err;
 	ret = register_shrinker(&workingset_shadow_shrinker);
-- 
2.12.0

[toc] | [next] | [standalone]


#1607260 — Re: [PATCH] mm: workingset: fix premature shadow node shrinking with cgroups

FromVladimir Davydov <vdavydov@tarantool.org>
Date2017-03-23 09:50 +0100
SubjectRe: [PATCH] mm: workingset: fix premature shadow node shrinking with cgroups
Message-ID<to6Bs-8ck-15@gated-at.bofh.it>
In reply to#1606118
On Tue, Mar 21, 2017 at 08:53:20PM -0400, Johannes Weiner wrote:
> 0a6b76dd23fa ("mm: workingset: make shadow node shrinker memcg aware")
> enabled cgroup-awareness in the shadow node shrinker, but forgot to
> also enable cgroup-awareness in the list_lru the shadow nodes sit on.
> 
> Consequently, all shadow nodes are sitting on a global (per-NUMA node)
> list, while the shrinker applies the limits according to the amount of
> cache in the cgroup its shrinking. The result is excessive pressure on
> the shadow nodes from cgroups that have very little cache.
> 
> Enable memcg-mode on the shadow node LRUs, such that per-cgroup limits
> are applied to per-cgroup lists.
> 
> Fixes: 0a6b76dd23fa ("mm: workingset: make shadow node shrinker memcg aware")
> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
> Cc: <stable@vger.kernel.org> # 4.6+

Acked-by: Vladimir Davydov <vdavydov@tarantool.org>

> ---
>  mm/workingset.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/workingset.c b/mm/workingset.c
> index ac839fca0e76..eda05c71fa49 100644
> --- a/mm/workingset.c
> +++ b/mm/workingset.c
> @@ -532,7 +532,7 @@ static int __init workingset_init(void)
>  	pr_info("workingset: timestamp_bits=%d max_order=%d bucket_order=%u\n",
>  	       timestamp_bits, max_order, bucket_order);
>  
> -	ret = list_lru_init_key(&shadow_nodes, &shadow_nodes_key);
> +	ret = __list_lru_init(&shadow_nodes, true, &shadow_nodes_key);
>  	if (ret)
>  		goto err;
>  	ret = register_shrinker(&workingset_shadow_shrinker);
> -- 
> 2.12.0
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web