Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp5513251ybf; Thu, 5 Mar 2020 02:02:46 -0800 (PST) X-Google-Smtp-Source: ADFU+vsDp7s3uYG5EOOHXDlDcDTaG/4md7Auncx0NVO5G/MEJrgtUPeu157gToU/YnQCj4plVDOM X-Received: by 2002:a05:6808:b29:: with SMTP id t9mr4857743oij.64.1583402566174; Thu, 05 Mar 2020 02:02:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583402566; cv=none; d=google.com; s=arc-20160816; b=0PnnTuiAKO8g/YmiE33dHYY5BFFtGzPhHwbWOuNct8i0nkYILSy8aV7D7p5r2EaE8k 2/ZuXvh1Lf1TuGLc10UOdVpWI8+aYh8YtDNGvphsOg2dFh3JLrnY9wu9yN5o6VYIByj4 TTMVplv2X88M+FFGOq7Y6UXOw/vRJK3H2+ycDQ8unosUnWa06abJjPQbR3OK/hRuhfXu ty9NcqTOrOU4kaJYhCA5/L+m23bMNOqCG8aeFo7pvARWG4gmYhEdmjjQACWOtOyK/CzN RF2paHwHlsXJO1SyK+jrAoR47RBm2NNu/1h/gWSJuG/BnSTRAsDnprtOWqVoaKe/pwLu d4JQ== 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=N+VHYLrvI+7e0ZVMs5A2YwvXMlQT1Gheq6HEnWaXrHg=; b=Hrc+KXdWVkZL2KJaRu50wqB4Bl+ODxdAW3Avv125ks+LrngvUcgfFDwX9LhbTwRl/A JOznhWj6cdpmsWSH84xg6peEVbAokszAcUJ5u+3+oVNNUAUPbvAADNXgnKREWk1m0mRt 3NBDXFjZet2AN/sf0+wkVrKwQWzW1bNVuBkhzDTQDWOsmHIvW6M1RG0X73uRu4dZwYAm 72FhZBjGjYCXTepWmoSTXT1eULGEHV9/VlYjRlLGDfUifuRq0YlInTE7u6HomU9pVgzt PLNdpGT5y8JFLjXWxb+l8byBhdb6t5oh3Vxvq31LKltYLSU05vUdmnv/rNoZe/Vv+BTK C1Rg== 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 j20si3010225otp.147.2020.03.05.02.02.34; Thu, 05 Mar 2020 02:02:46 -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 S1727455AbgCEKA1 (ORCPT + 99 others); Thu, 5 Mar 2020 05:00:27 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:37958 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727049AbgCEKA0 (ORCPT ); Thu, 5 Mar 2020 05:00:26 -0500 Received: by mail-wm1-f65.google.com with SMTP id u9so5004430wml.3; Thu, 05 Mar 2020 02:00:25 -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=N+VHYLrvI+7e0ZVMs5A2YwvXMlQT1Gheq6HEnWaXrHg=; b=bhyksl/2dsNRmdBN5+5IiXymbHl3MnUtSSq7uoI1qNzqAbKktR97O0QY4ngO6yBIXl Fcfhmnw31EaYAdgnRSCb6o6TarDXeLq3+1GyHQHEAQoZcvdGX7AfIKnBaZ4Lfba5YDRz 3OUfoZxt8m2YtXo4iXO69ksFpf/MOEL9urYFdVgZboBDteLAqIDCt4Xs2dBwODjE+Woi SD/7WhGiPxCkT35LgHtoWpxdsVh0reff7DjUhGrh2bYObZPrzpoCOHtNzgv61kY0AdTn Nj5euNAbnfCG5RdCGRT1SYnUz9hDk6v4Yg1aduBDGuJIA5tS7UyzUIkR1yBwBt6MB1uV dXTg== X-Gm-Message-State: ANhLgQ10h5UM/MqBv3IyVHgd1FKmdv1Tj2uX1J2Mk3rgAaQUsC88mKt4 xsM+vyVH2clz4LjzF7VH9Cw= X-Received: by 2002:a1c:7c08:: with SMTP id x8mr8419345wmc.71.1583402424648; Thu, 05 Mar 2020 02:00:24 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id 25sm8514392wmg.30.2020.03.05.02.00.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2020 02:00:23 -0800 (PST) Date: Thu, 5 Mar 2020 11:00:23 +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: <20200305100023.GR16139@dhcp22.suse.cz> References: <20200304142348.48167-1-vincenzo.frascino@arm.com> <20200304165336.GO16139@dhcp22.suse.cz> <8c489836-b824-184e-7cfe-25e55ab73000@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8c489836-b824-184e-7cfe-25e55ab73000@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 05-03-20 09:49:23, Vincenzo Frascino wrote: > Hi Michal, > > On 3/4/20 4:53 PM, Michal Hocko wrote: > > 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. > > > > Thank you for pointing this out, I was not aware of it. I understand that you > are against "#ifdeffery" in this case, but isn't it the case of adding at least > __maybe_unused? This would prevent people from reporting it over and over again > and you to have to push them back :) Let me know what do you think, in case I am > happy to change my patch accordingly. We have discussed __maybe_unused in the email thread as well. I am not a great fan of that as mentioed there. -- Michal Hocko SUSE Labs