Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4977831ybi; Tue, 30 Jul 2019 11:30:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqx2dcSI+Gxvws45PIF4FttdGn9PYCeEfp5S7e7xTLFSmLla8LSQLsAlGTXRL7H+7LEyJvv3 X-Received: by 2002:a63:394:: with SMTP id 142mr35961127pgd.43.1564511428432; Tue, 30 Jul 2019 11:30:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564511428; cv=none; d=google.com; s=arc-20160816; b=I70wW7uWPh6jz+Iw33qpXKsV8jt4/rm+HcI11lpDvmzt+jp4xKcvsgRtJx+za9ud4H EwM671I3eeemylKEjk0wioJinNdsB8fZJ7SAbqDaWBZxqDGwLevl6R2m2wo+fLa5Ztgw 8Pn9gZw50K2I5nPgjKPjU+CLJFK4sghFoMi6/KIwqZVIEDQQc8IqbLsDXPD5o8y1trM0 dKJnZLbB6xXjVqirvMQ5Kzjem+wTyNhtWgdXY9/MZbu3UEEDNKlxpIqja1A2Gs4bmF9N 7hWkTM0Yb1uuvw4fFi9OVkY3oICFRmh6fS49TUnAT8AR4qPTBOAaP4My2m++78MktBtG PV0w== 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; bh=wvsOsY5CLQsky8uz4ClfHVAjHjhjUTEeWUp/GJcH9vg=; b=w898dGcYgo0toPl2fPRJ0wQrtFySZpDv/tfpHtIeNzKUNhSThIIgLw/43QFUgv070k gJx6Z9dN3JoCatlxefSGYBuvn8BVgmZeZCAqGhoP2KysqCRxlONNDlCOOCtCj6n3C6tE LYa/P4Pagbvev94Fqm2E2gPr94Fy81kHhzvsLOzJJ8V8XyEnH1UOTH9AIQkB3SJe2apK 2T1hRt673gwhUH8vXZTiE054tmA9Jjvzgd0G2KczgK3paMe88+QBQmOZQ9ig3mjMGFPA ceWKgbA1eOlBlruWdYiWe3hDCotIMy5iMS369iGPsaeMXJQ0567IHYFWL44kCOniHMBE LWOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rrckOx3I; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c1si26997435plr.405.2019.07.30.11.30.12; Tue, 30 Jul 2019 11:30:28 -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=pass header.i=@gmail.com header.s=20161025 header.b=rrckOx3I; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729659AbfG3S2H (ORCPT + 99 others); Tue, 30 Jul 2019 14:28:07 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:38594 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726522AbfG3S2H (ORCPT ); Tue, 30 Jul 2019 14:28:07 -0400 Received: by mail-wm1-f66.google.com with SMTP id s15so36167834wmj.3; Tue, 30 Jul 2019 11:28:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=wvsOsY5CLQsky8uz4ClfHVAjHjhjUTEeWUp/GJcH9vg=; b=rrckOx3Ihb+ID9d4P65+Fyq+4f0d0RK+viITtEC/PCnIRlbUYceRhBOVpLCZEV//zb y6hTtV2C9CMqNsjje6RId2eo8D5fq4iq8TW0qR5cWN3+VMJSPvthhpDvoCxsbzPqK+rV 7LlHLYu/9J3Fs3ej8sCF3XhoqF3dMRSJ6rbQHzcGjjkNly36gQ8WUg7EC2YxAN2zscM6 +I7OBL2/87MTAIrAF4X+BRRPp0aNzsEZlgqRlyWVlTjyUMCkpnHqWjiBk9yJTewEouiY BSQBfz0bMPXWS3pgzBIHY4HxzRZJk5eaMqlw7v28M1gkIpwrTnKkMDSyMYGihCMw5svS jGpw== 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=wvsOsY5CLQsky8uz4ClfHVAjHjhjUTEeWUp/GJcH9vg=; b=Ss/MxwEbsFaNt/NeziGxTysXKuQpbmMEdY8qiJglWzLF0CHB6Ff1fz3FLarUX5h8qY RCuhAXXobsxd/F3sQ65DyPbk/bF28Yi659h/80YQT4muDMfe2LgXh7UXohQbMZZLl8rE LkfGUfou/1FB90AD0x8RoeLx1wcwi+wd23GfHzOJvFfHp2jkYlRo2RWg1wkaOW8j4xuW qYvdQgFD0dIK1APzL8LQAoyOsMnePEtwgIQURFivp/mRc+M38TaWYCl/ZTF1koDULcLr 5k/p01J7pIRQpsOPrO1O6SDRJJlu7Pom4FvKyGZ/tk1einRkT+9ROOwU7Jy2JXSadt/j X8IA== X-Gm-Message-State: APjAAAVv71KNsoEIk04U/fBJhNund6BCj7brsrJG3XKlkDEstNX9yaf1 wmLlYo8rKj/13Kkhw6CaGFI= X-Received: by 2002:a7b:cf0b:: with SMTP id l11mr111949106wmg.143.1564511283748; Tue, 30 Jul 2019 11:28:03 -0700 (PDT) Received: from archlinux-threadripper ([2a01:4f8:222:2f1b::2]) by smtp.gmail.com with ESMTPSA id v204sm69670944wma.20.2019.07.30.11.28.02 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 30 Jul 2019 11:28:02 -0700 (PDT) Date: Tue, 30 Jul 2019 11:28:01 -0700 From: Nathan Chancellor To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Qian Cai , "Peter Zijlstra (Intel)" , Linus Torvalds , Thomas Gleixner , Ingo Molnar , Sasha Levin Subject: Re: [PATCH 4.14 054/293] sched/fair: Fix "runnable_avg_yN_inv" not used warnings Message-ID: <20190730182801.GA94301@archlinux-threadripper> References: <20190729190820.321094988@linuxfoundation.org> <20190729190828.058944959@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190729190828.058944959@linuxfoundation.org> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 29, 2019 at 09:19:05PM +0200, Greg Kroah-Hartman wrote: > [ Upstream commit 509466b7d480bc5d22e90b9fbe6122ae0e2fbe39 ] > > runnable_avg_yN_inv[] is only used in kernel/sched/pelt.c but was > included in several other places because they need other macros all > came from kernel/sched/sched-pelt.h which was generated by > Documentation/scheduler/sched-pelt. As the result, it causes compilation > a lot of warnings, > > kernel/sched/sched-pelt.h:4:18: warning: 'runnable_avg_yN_inv' defined but not used [-Wunused-const-variable=] > kernel/sched/sched-pelt.h:4:18: warning: 'runnable_avg_yN_inv' defined but not used [-Wunused-const-variable=] > kernel/sched/sched-pelt.h:4:18: warning: 'runnable_avg_yN_inv' defined but not used [-Wunused-const-variable=] > ... > > Silence it by appending the __maybe_unused attribute for it, so all > generated variables and macros can still be kept in the same file. > > Signed-off-by: Qian Cai > Signed-off-by: Peter Zijlstra (Intel) > Cc: Linus Torvalds > Cc: Peter Zijlstra > Cc: Thomas Gleixner > Link: https://lkml.kernel.org/r/1559596304-31581-1-git-send-email-cai@lca.pw > Signed-off-by: Ingo Molnar > Signed-off-by: Sasha Levin > --- > Documentation/scheduler/sched-pelt.c | 3 ++- > kernel/sched/sched-pelt.h | 2 +- > 2 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/Documentation/scheduler/sched-pelt.c b/Documentation/scheduler/sched-pelt.c > index e4219139386a..7238b355919c 100644 > --- a/Documentation/scheduler/sched-pelt.c > +++ b/Documentation/scheduler/sched-pelt.c > @@ -20,7 +20,8 @@ void calc_runnable_avg_yN_inv(void) > int i; > unsigned int x; > > - printf("static const u32 runnable_avg_yN_inv[] = {"); > + /* To silence -Wunused-but-set-variable warnings. */ > + printf("static const u32 runnable_avg_yN_inv[] __maybe_unused = {"); > for (i = 0; i < HALFLIFE; i++) { > x = ((1UL<<32)-1)*pow(y, i); > > diff --git a/kernel/sched/sched-pelt.h b/kernel/sched/sched-pelt.h > index a26473674fb7..c529706bed11 100644 > --- a/kernel/sched/sched-pelt.h > +++ b/kernel/sched/sched-pelt.h > @@ -1,7 +1,7 @@ > /* SPDX-License-Identifier: GPL-2.0 */ > /* Generated by Documentation/scheduler/sched-pelt; do not modify. */ > > -static const u32 runnable_avg_yN_inv[] = { > +static const u32 runnable_avg_yN_inv[] __maybe_unused = { > 0xffffffff, 0xfa83b2da, 0xf5257d14, 0xefe4b99a, 0xeac0c6e6, 0xe5b906e6, > 0xe0ccdeeb, 0xdbfbb796, 0xd744fcc9, 0xd2a81d91, 0xce248c14, 0xc9b9bd85, > 0xc5672a10, 0xc12c4cc9, 0xbd08a39e, 0xb8fbaf46, 0xb504f333, 0xb123f581, > -- > 2.20.1 > > > This patch does nothing in 4.14. There is no kernel/sched/pelt.c. $ fd pelt kernel/sched/sched-pelt.h Documentation/scheduler/sched-pelt.c runnable_avg_yN_inv is only used in one location in 4.14.134, in fair.c behind CONFIG_SMP, which is also the guard that includes sched-pelt.h. $ rg --no-heading -g '!Documentation' runnable_avg_yN_inv kernel/sched/sched-pelt.h:4:static const u32 runnable_avg_yN_inv[] = { kernel/sched/fair.c:2849: val = mul_u64_u32_shr(val, runnable_avg_yN_inv[local_n], 32); $ rg --no-heading -B 2 "sched-pelt.h" kernel/sched/fair.c-707-#ifdef CONFIG_SMP kernel/sched/fair.c-708- kernel/sched/fair.c:709:#include "sched-pelt.h" I see no way for the warnings in this patch to occur here, making it pointless. I get two trivial conflicts in my msm-4.14 tree from this patch that I would like to avoid dealing with. Please consider dropping this patch, thanks! Nathan