Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5168553ybi; Tue, 30 Jul 2019 15:16:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSFJqWwXOfKsNKXZtIS7KCCMgDUmvSyFP5ESEqIEVXpI3+o0dZvLvf+jac4m73+k3L4U2F X-Received: by 2002:a17:902:d715:: with SMTP id w21mr79517156ply.261.1564525015563; Tue, 30 Jul 2019 15:16:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564525015; cv=none; d=google.com; s=arc-20160816; b=DNrfEsdBY7a8yvvzTGmR1LmDw17+wxgNS+//rtvpTOl1YOPnf9NlMR/OSWh6sHRh9Y dm8/7MnGRndW7uQ1KBeQCVwWUK/2juN4F/vsv9YF0eSmWBFpUGZOcR9M+upZswjWqKBh GRoaH5yPsRpa4i6mzMELEy4vwoWVqdPc/33zhkP3ABh/GuAcG4C0R0N6NApZIwOjDqZa JjGvTbeqPu1BeAJ9CcyLcIaHXjkGFmx41SQ8+uiPpzymW41pn0kRP2z7/cvwfB6tdgAc Yl1hHmVNHkT2egI1yYy+n8M8j4KycmLZDrbpTB9WWB4uPfI5O66e/RhUzl64dy3qmAba poyg== 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=9tLcRZ2GoiA5zQ6DAMqcjiJJ702o73kFpOcUJO7VVzs=; b=00ZeArP3MRF/n6RxZUHap3UQyg70Ih3OJbsuqVkr70JEjfj7TXbePbFtMBdPwbb2Fe LVA0gXvF6GuFkLhzpzp9g2OpKqcoJfAtmdO2GX7e4V7WtIqMF251Zl6szmcYVl0VdLkh /RAxWGWVqnLpTR4tazlfgN3bhklaLVlFvbfeRRP0lmPjcUG0xjbf7WRtSdTpq0dpsfgY 7YgersKqnk3JCrQnJDwqHilbHhPCyC1WvMViCTvW77w2pGb+WlPNMYP/fGruMQJmKo9u h9bGg7Y/HKGkELe9/p37AheYQxJiHXuE1lQ/5Ssrwi8XA7mDc/WxgSqS4immyhRs/BSL 3TGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MClK7EC2; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 60si28244373plf.398.2019.07.30.15.16.40; Tue, 30 Jul 2019 15:16:55 -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=@kernel.org header.s=default header.b=MClK7EC2; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729929AbfG3Si5 (ORCPT + 99 others); Tue, 30 Jul 2019 14:38:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:56732 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726165AbfG3Si4 (ORCPT ); Tue, 30 Jul 2019 14:38:56 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0BD99206A2; Tue, 30 Jul 2019 18:38:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564511935; bh=OChHIstTK2zdB+afth0r88I81U8buXZ9fswSRaKxvq0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MClK7EC2EGSMMykLIzctg8O6K4hjl6libkpRSi8PMGmwFu1gvJg9B/Ck4tHy5X1pi UMvoiBDZ7c290TOmgDlnEYOKtUSgrchkHRIhTxqOKKlt+rcUvTxh/vB4j29u/UT/+P yyn1Ww2p2Y2DU5sK7LBIHm3TsslVtLEM1slrH+A4= Date: Tue, 30 Jul 2019 20:38:53 +0200 From: Greg Kroah-Hartman To: Nathan Chancellor 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: <20190730183853.GA5169@kroah.com> References: <20190729190820.321094988@linuxfoundation.org> <20190729190828.058944959@linuxfoundation.org> <20190730182801.GA94301@archlinux-threadripper> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190730182801.GA94301@archlinux-threadripper> 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 Tue, Jul 30, 2019 at 11:28:01AM -0700, Nathan Chancellor wrote: > 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! Now dropped, thanks. greg k-h