Received: by 10.213.65.68 with SMTP id h4csp1321286imn; Wed, 21 Mar 2018 07:58:29 -0700 (PDT) X-Google-Smtp-Source: AG47ELvMqsw9GnP6t5GV2hm9doUvfeO8XuvkLv+Fza8fEYj42VFFnCew8WXSD07HIzq1/Hu9TdrM X-Received: by 2002:a17:902:7502:: with SMTP id i2-v6mr4013829pll.220.1521644309182; Wed, 21 Mar 2018 07:58:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521644309; cv=none; d=google.com; s=arc-20160816; b=Tsnhlczy7i4KAZ6gPpxhslK+EpuPpX4sSySll9tlS0a7MV8GINQWMLvDtl95rFqS95 VA0MCc4JX7uFqAahjOcs7b7euB+DtQwFZZ4dbx0/knGmYs1JzgqBQAHPrCwk8qdVpBKn PUbwxVqprYNP9dLTvhKA6ZlI+mR1GlsNHbApAMK750hKvebWKytQklRsD5FSyUJgsX9r RoLGMwctQMgyrlGK7l0ESawGB8aqkrOFH3cHm6uc8eo0WovlS7EjHPdkz0YVVIuW3DoC wUdbc5NCZRiL6zt1V8vklT8IHpVwx+SkujE/Y016bn5697ddMZf5Y+urKCGJOe8Z2W1o L3Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=x78mglObPLPEW7Yxwk7KGlSHs+OxJMUXPZy/9POnDx8=; b=crBPtSdkdnAwNgDT6pzJR8SUr4YbHo6owhl9Z70WF94mrOX9j2jnzQw2Eq8eIvGqX6 itw6/+pyebxxkjLaaAty0IomTW2i9kdlS+ht/lD+c/Pqv8se8XZ+ZNtXvKi9ETKp/9K/ 7+I/FG8q3GCjc48nnKJ8UxbQSCKj8yGUWhwx7ZBjfjERFLYl+9YRSu/+d8td5Jwee1yA oTvA3cr1wz3NsP7KhUF8jnAYFU9CtTsNrXVj8P6lyFn7vE6KAcY96YTN8QPOPpBtXgJz VMOloje5FP+YzAMjvLqidgQnBaRvctC4ykHRHbX9aOJgRCjDQmbNe37zUEEuOVB63Ws2 13Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=fYiH8fNi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 37-v6si4032562plq.451.2018.03.21.07.58.14; Wed, 21 Mar 2018 07:58:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=fYiH8fNi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752309AbeCUO5H (ORCPT + 99 others); Wed, 21 Mar 2018 10:57:07 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:55122 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752066AbeCUO5G (ORCPT ); Wed, 21 Mar 2018 10:57:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=x78mglObPLPEW7Yxwk7KGlSHs+OxJMUXPZy/9POnDx8=; b=fYiH8fNiYAttJLL/s/Ex0r7U5 Xyj5KdmEacxXYPVamG2SWy4b2Wy4AphFS5zWTO+X0nm7aUAyZC2WzLRycu0+6+hwRKNBtpDxF/Pnp Xvk0HrwgdgSvbhaJtBmRduEq2ZogRsJwTLFrO8gzurp3dhlFbIneWg7pPC3YD3BsFim0yQfr0NTLf ENTVZYvNKYECiiI/gAqS3PqeyV7o+2yG0FiHGXLuoW5oGPP5xii4lpheYnQYIG5HPHbUVcm3wAf2r UecB5mnwSOmNp7cpSC9fTV2rUYsrfX6/WCoWtatKk+cASqRt5Tpv4Jv6r+ppw+zqVlmK1j2cTu8FQ BMdnQ3d/w==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1eyfA9-0006BO-Se; Wed, 21 Mar 2018 14:56:25 +0000 Date: Wed, 21 Mar 2018 07:56:25 -0700 From: Matthew Wilcox To: Kirill Tkhai Cc: viro@zeniv.linux.org.uk, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, akpm@linux-foundation.org, tglx@linutronix.de, pombredanne@nexb.com, stummala@codeaurora.org, gregkh@linuxfoundation.org, sfr@canb.auug.org.au, guro@fb.com, mka@chromium.org, penguin-kernel@I-love.SAKURA.ne.jp, chris@chris-wilson.co.uk, longman@redhat.com, minchan@kernel.org, hillf.zj@alibaba-inc.com, ying.huang@intel.com, mgorman@techsingularity.net, shakeelb@google.com, jbacik@fb.com, linux@roeck-us.net, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 03/10] mm: Assign memcg-aware shrinkers bitmap to memcg Message-ID: <20180321145625.GA4780@bombadil.infradead.org> References: <152163840790.21546.980703278415599202.stgit@localhost.localdomain> <152163850081.21546.6969747084834474733.stgit@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <152163850081.21546.6969747084834474733.stgit@localhost.localdomain> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 21, 2018 at 04:21:40PM +0300, Kirill Tkhai wrote: > +++ b/include/linux/memcontrol.h > @@ -151,6 +151,11 @@ struct mem_cgroup_thresholds { > struct mem_cgroup_threshold_ary *spare; > }; > > +struct shrinkers_map { > + struct rcu_head rcu; > + unsigned long *map[0]; > +}; > + > enum memcg_kmem_state { > KMEM_NONE, > KMEM_ALLOCATED, > @@ -182,6 +187,9 @@ struct mem_cgroup { > unsigned long low; > unsigned long high; > > + /* Bitmap of shrinker ids suitable to call for this memcg */ > + struct shrinkers_map __rcu *shrinkers_map; > + > /* Range enforcement for interrupt charges */ > struct work_struct high_work; > Why use your own bitmap here? Why not use an IDA which can grow and shrink automatically without you needing to play fun games with RCU?