Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932987AbdCWIkb (ORCPT ); Thu, 23 Mar 2017 04:40:31 -0400 Received: from fallback5.mail.ru ([94.100.181.253]:42488 "EHLO fallback5.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752263AbdCWIk3 (ORCPT ); Thu, 23 Mar 2017 04:40:29 -0400 Date: Thu, 23 Mar 2017 11:28:22 +0300 From: Vladimir Davydov To: Johannes Weiner Cc: Andrew Morton , Michal Hocko , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH] mm: workingset: fix premature shadow node shrinking with cgroups Message-ID: <20170323082822.GA17625@esperanza> References: <20170322005320.8165-1-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170322005320.8165-1-hannes@cmpxchg.org> Authentication-Results: smtp52.i.mail.ru; auth=pass smtp.auth=vdavydov@tarantool.org smtp.mailfrom=vdavydov@tarantool.org X-Mru-Trust-IP: 1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1555 Lines: 39 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 > Cc: # 4.6+ Acked-by: Vladimir Davydov > --- > 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 >