Received: by 2002:a17:90a:9307:0:0:0:0 with SMTP id p7csp5099812pjo; Wed, 4 Mar 2020 08:54:31 -0800 (PST) X-Google-Smtp-Source: ADFU+vu50QUUuo8+XlsWoJ/ihX6YQULk8UKQQXXyg8SwAUa88CNTgOaaSNaMgDbjt01iE3/Xbz4S X-Received: by 2002:aca:5546:: with SMTP id j67mr2559975oib.0.1583340871167; Wed, 04 Mar 2020 08:54:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583340871; cv=none; d=google.com; s=arc-20160816; b=lpXe9NALu0KtqkosaNT6HVr1ye2TRiH6rk55OOOtgWaMg+7llT517IQGGCLmfFc6h6 pFxoL4PQq19XizuvFBAmzgl9t4vxsr2fR4r/SnZFpgf4sEdaV+UPGOc0JpOrQgWYJxSr 1RRX2NKQ7Uyd7df4khAAzPNtJIfKcU1+h4ZdfFEaelDlIlbYmjA5+FPc97OnBJQzxpdJ J1H/9eyreont6meadGQ/Gt8H9KHLUPgNkIYBWGSQ2JXkLnBH3DD9hsV+GeA5twniINYu 2xaa7WkqTNxMpeC4zMlHxzxYdLOWyzz7m36pHD/MH6A3WfJuRuTPJYG2zhCMkT86eNga 61Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=9rthIHoO9WYjIeblpibGccs1Xx6gpCOxnW4ZP2a/gaI=; b=KoczNabx9531FxrIhsy+rgUXFhFktdek9iNCnFZVgdCsqp73jAtCpe01S8UeTSGdXU lRAJpEFspZp1y5Q/RIqS8cWRsYQqZTfMQCBrwm7zNh9fkj6TkqOqHchl3uBBmnJuo8/A WB9Brt24vFBbrV103BZw0nIO995KH5Q7nK0mlxFCVnxGNac7RyVSyTl1IRDhgCvI7COl FqsOhHHrfa1BObmcGllkVZGh556xHAS3VLpTV46pp1snmwSyam9XG3AWtOZI6XAKfcaG dhoQnjCBMp9SuzWMMF2kMhb+pLPEJ8a5C79UuIQTfA1Kq8x6pa3HhlarJbnrhkTObUaK s37A== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g35si1604497otg.32.2020.03.04.08.54.16; Wed, 04 Mar 2020 08:54:31 -0800 (PST) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729588AbgCDQxp (ORCPT + 99 others); Wed, 4 Mar 2020 11:53:45 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:36738 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725765AbgCDQxp (ORCPT ); Wed, 4 Mar 2020 11:53:45 -0500 Received: by mail-wm1-f66.google.com with SMTP id g83so2599836wme.1; Wed, 04 Mar 2020 08:53:43 -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:content-transfer-encoding :in-reply-to; bh=9rthIHoO9WYjIeblpibGccs1Xx6gpCOxnW4ZP2a/gaI=; b=FSFB3ksVA2joFhOkeDEPMJLvySl97AX2sQLQKOX3jH94yhgjIleNT/oFzy/CmPu536 v2E6+sFEYIM5OAQoHFf7HORrKk0mcB9L01YEjXnRwH8Vg0opFbMjGJk8gHsevS3SC/E4 oXEFYX3T3ItWHMZeYXoHnqS9W3VfbL0dwu93dZwu8megfOtUL5RYRS0QNInjpH+Teld4 7EM612uUpU4ByW8znpqUXm+yON2cOFlVkk+ipg3xXV8aZJjHm5VyjOV5nf85hS5z9Vm1 o5Ug59i3gwtB9CFwnMeNhIL1t692arEv3T2TW1JKF7dDhJOxes9FID6kiRm1Czooop4d CVqA== X-Gm-Message-State: ANhLgQ22Bzhh/N1HfhAtsdSH72hqNToJl4ogCcasQZSZ/3gxrtLOmtgf KgyGP6mZ88n+qF1ecbtQ4zg= X-Received: by 2002:a1c:2d4f:: with SMTP id t76mr4412820wmt.60.1583340819177; Wed, 04 Mar 2020 08:53:39 -0800 (PST) Received: from localhost (ip-37-188-250-99.eurotel.cz. [37.188.250.99]) by smtp.gmail.com with ESMTPSA id n11sm6649329wrw.11.2020.03.04.08.53.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2020 08:53:38 -0800 (PST) Date: Wed, 4 Mar 2020 17:53:36 +0100 From: Michal Hocko To: Vincenzo Frascino Cc: cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Johannes Weiner , Vladimir Davydov , Andrew Morton Subject: Re: [PATCH] mm: Make mem_cgroup_id_get_many dependent on MMU and MEMCG_SWAP Message-ID: <20200304165336.GO16139@dhcp22.suse.cz> References: <20200304142348.48167-1-vincenzo.frascino@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200304142348.48167-1-vincenzo.frascino@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 04-03-20 14:23:48, Vincenzo Frascino wrote: > mem_cgroup_id_get_many() is currently used only when MMU or MEMCG_SWAP > configuration options are enabled. Having them disabled triggers the > following warning at compile time: > > linux/mm/memcontrol.c:4797: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) > > Make mem_cgroup_id_get_many() dependent on MMU and MEMCG_SWAP to address > the issue. A similar patch has been proposed recently http://lkml.kernel.org/r/87fthjh2ib.wl-kuninori.morimoto.gx@renesas.com. The conclusion was that the warning is not really worth adding code. > Cc: Johannes Weiner > Cc: Michal Hocko > Cc: Vladimir Davydov > Cc: Andrew Morton > Signed-off-by: Vincenzo Frascino > --- > mm/memcontrol.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index d09776cd6e10..628cebeb4bdd 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -4794,10 +4794,12 @@ static void mem_cgroup_id_remove(struct mem_cgroup *memcg) > } > } > > +#if defined(CONFIG_MEMCG_SWAP) || defined(CONFIG_MMU) > static void mem_cgroup_id_get_many(struct mem_cgroup *memcg, unsigned int n) > { > refcount_add(n, &memcg->id.ref); > } > +#endif > > static void mem_cgroup_id_put_many(struct mem_cgroup *memcg, unsigned int n) > { > -- > 2.25.1 -- Michal Hocko SUSE Labs