From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DF1AC43603 for ; Tue, 17 Dec 2019 09:53:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 58C4C20733 for ; Tue, 17 Dec 2019 09:53:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58C4C20733 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D0D748E004D; Tue, 17 Dec 2019 04:53:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CBE458E0040; Tue, 17 Dec 2019 04:53:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BAD9B8E004D; Tue, 17 Dec 2019 04:53:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0139.hostedemail.com [216.40.44.139]) by kanga.kvack.org (Postfix) with ESMTP id A11F98E0040 for ; Tue, 17 Dec 2019 04:53:32 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 566D78249980 for ; Tue, 17 Dec 2019 09:53:32 +0000 (UTC) X-FDA: 76274171064.08.curve11_3bf23a4d00a2c X-HE-Tag: curve11_3bf23a4d00a2c X-Filterd-Recvd-Size: 4462 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Tue, 17 Dec 2019 09:53:31 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id b19so2230664wmj.4 for ; Tue, 17 Dec 2019 01:53:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=o5H78lmOFlfOdJKIlFL+etqdkLu7Sq64ZBZTXREj8QE=; b=sQHnbHH5Qyy2aV3b0SdFCtymCjUPkVPDAgRG7NjlBVuhK1BxPLMaVfNtJ2AFcI3S6t ty3cSSLYzSgFZU8MGxsgFf190HFx+mW2RfdrKJJgZjVk6bDEHsh8UGFzzGUio3b5DkB9 y9UI6dNdsst6rG19zWuTPQRDx8s4zW8m9AH1A4WB5c8BJtJ3Zaz/rG32hJUuliIi95VE 4ilkXTccg09pnxwZ2O7eQ5vXPxmR81nEm75YZzhruFvANWlGaGODjAIvaeeYr+0VoPUt +lvRFSk+v2/Y8hid4EHBT7W0sOGVuSdCrZTXvklbX1CEWYMuneV+/qwZjwc0/D/nuVW5 6tGQ== X-Gm-Message-State: APjAAAUT6mR2AOj6NMiWnJ3UtrrEBy/BhnbbUiHjYm8sH/HjLH04Xz00 wyaQf0B93gNNAKISaby+/co= X-Google-Smtp-Source: APXvYqwR57vUhgJ1DahqMNJVmeW0KAEB6xrA7+hS53GMuCH7lnSLkqx0ooT/uxz+bl1I2z2k1Lzhbg== X-Received: by 2002:a1c:9a52:: with SMTP id c79mr4337529wme.127.1576576410868; Tue, 17 Dec 2019 01:53:30 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id i5sm2359682wml.31.2019.12.17.01.53.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 01:53:30 -0800 (PST) Date: Tue, 17 Dec 2019 10:53:29 +0100 From: Michal Hocko To: Kuninori Morimoto Cc: Johannes Weiner , Vladimir Davydov , Andrew Morton , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: memcontrol.c: move mem_cgroup_id_get_many under CONFIG_MMU Message-ID: <20191217095329.GD31063@dhcp22.suse.cz> References: <87fthjh2ib.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87fthjh2ib.wl-kuninori.morimoto.gx@renesas.com> User-Agent: Mutt/1.12.2 (2019-09-21) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue 17-12-19 15:47:40, Kuninori Morimoto wrote: > From: Kuninori Morimoto > > mem_cgroup_id_get_many() is used under CONFIG_MMU. Not really. It is used when SWAP is enabled currently. But it is not really bound to the swap functionality by any means. It just happens that we do not have other users currently. We might put it under CONFIG_SWAP but I do not really think it is a big improvement. > This patch moves it to under CONFIG_MMU. > We will get below warning without this patch > if .config doesn't have CONFIG_MMU. > > LINUX/mm/memcontrol.c:4814:13: warning: 'mem_cgroup_id_get_many'\ > defined but not used [-Wunused-function] > static void mem_cgroup_id_get_many(struct mem_cgroup *memcg, unsigned int n) > ^~~~~~~~~~~~~~~~~~~~~~ Is this warning really a big deal? The function is not used, alright, and the compiler will likely just drop it. > Signed-off-by: Kuninori Morimoto > --- > mm/memcontrol.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index c5b5f74..8a157ef 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -4811,11 +4811,6 @@ static void mem_cgroup_id_remove(struct mem_cgroup *memcg) > } > } > > -static void mem_cgroup_id_get_many(struct mem_cgroup *memcg, unsigned int n) > -{ > - refcount_add(n, &memcg->id.ref); > -} > - > static void mem_cgroup_id_put_many(struct mem_cgroup *memcg, unsigned int n) > { > if (refcount_sub_and_test(n, &memcg->id.ref)) { > @@ -5153,6 +5148,11 @@ static void mem_cgroup_css_reset(struct cgroup_subsys_state *css) > } > > #ifdef CONFIG_MMU > +static void mem_cgroup_id_get_many(struct mem_cgroup *memcg, unsigned int n) > +{ > + refcount_add(n, &memcg->id.ref); > +} > + > /* Handlers for move charge at task migration. */ > static int mem_cgroup_do_precharge(unsigned long count) > { > -- > 2.7.4 -- Michal Hocko SUSE Labs