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=-0.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 D6180C43603 for ; Tue, 17 Dec 2019 13:54:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7D7832067C for ; Tue, 17 Dec 2019 13:54:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chrisdown.name header.i=@chrisdown.name header.b="NBYb0wme" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D7832067C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chrisdown.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DDF608E0067; Tue, 17 Dec 2019 08:54:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D90068E0040; Tue, 17 Dec 2019 08:54:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA5398E0067; Tue, 17 Dec 2019 08:54:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0146.hostedemail.com [216.40.44.146]) by kanga.kvack.org (Postfix) with ESMTP id B47568E0040 for ; Tue, 17 Dec 2019 08:54:43 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 4D9FF824999B for ; Tue, 17 Dec 2019 13:54:43 +0000 (UTC) X-FDA: 76274778846.23.actor87_8079695994649 X-HE-Tag: actor87_8079695994649 X-Filterd-Recvd-Size: 4341 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Tue, 17 Dec 2019 13:54:42 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id t14so3254238wmi.5 for ; Tue, 17 Dec 2019 05:54:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=0tDf420l6OJe0Bwhn9GE+pW7tyo0iSFruHkLYhzOzAo=; b=NBYb0wmeeE28IfoeJrHNR1nDrO2AHN8CdVfPvDeRfkbZeQiKbRNDWRDE53oyz1Qvin 1Z7E0QX1fhIgd7ApaTelr4wPdPP3JqfQJRxyV4VIziwJGIJr6WzgZDPtcapqvqlqReR7 Ylo8CwcB1K3wbYJWKBlqC8Kc8tQAW16Bt76kA= 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; bh=0tDf420l6OJe0Bwhn9GE+pW7tyo0iSFruHkLYhzOzAo=; b=TrS8KjJmnI6dy0DeS11NvxEBnt5wp7Btj5m6RVV5ksXsGwBtRRPWKeQJS0lj41O5pC QQ5LU3svQtt+co8qa/lTTKf5LVvC7gdgOKMyp8iXq3TsO4ZVJUtlecnYFz45HBX8iyNv ssmpsSdyw79e8cYD5g3pilzcn570LMw0SDFpXj9YIkxIpfN03VR/U7M7oSpT88wyJKpR G90u/atUDm/gmWWJLOGbCvKTzL4R0aTMPgIlJPJ8hEsD2iQqgeLLN7p0VggD7SRoBY5S CHlkIuWMOVDCm4ZmP1RC4I9cJEI6T11DYCsgdqeodlAIbcrFLelYV38XgNjb6fsvNQge CKRw== X-Gm-Message-State: APjAAAXWhl0L/m3XvvnWy3BSfwEdypNGrh3UVk27OcInfgM/NMcSJRg4 bRv+EAVGZVX3K1nC4Hr8IX81Yg== X-Google-Smtp-Source: APXvYqymxQF288/hhyASLUrJbI0GnBe6CY2DqQcMtrvEJHtVaNq5Y+tyGlDwmL1e5t1aoJrxF06sxw== X-Received: by 2002:a1c:c90e:: with SMTP id f14mr5703560wmb.47.1576590881556; Tue, 17 Dec 2019 05:54:41 -0800 (PST) Received: from localhost ([2620:10d:c092:180::1:f184]) by smtp.gmail.com with ESMTPSA id z6sm26950594wrw.36.2019.12.17.05.54.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 05:54:40 -0800 (PST) Date: Tue, 17 Dec 2019 13:54:40 +0000 From: Chris Down To: Michal Hocko Cc: Kuninori Morimoto , 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: <20191217135440.GB58496@chrisdown.name> References: <87fthjh2ib.wl-kuninori.morimoto.gx@renesas.com> <20191217095329.GD31063@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20191217095329.GD31063@dhcp22.suse.cz> 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: Hi Kuninori, Michal Hocko writes: >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. Agreed, I think we shouldn't wrap this in preprocessor conditionals it since it's entirely possible it will end up used elsewhere and we'll end up with a mess of #ifdefs. >> 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. Let's just add __maybe_unused, since it seems like what we want in this scenario -- it avoids new users having to enter preprocessor madness, while also not polluting the build output. Once you've done that, I'll send over my ack. :-) Thanks.