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=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 85C84C0650F for ; Tue, 30 Jul 2019 18:38:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5C78B20693 for ; Tue, 30 Jul 2019 18:38:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564511938; bh=OChHIstTK2zdB+afth0r88I81U8buXZ9fswSRaKxvq0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=GNUXVi0NbMyjaftQFL7Qfw234jlEKWBc+q1beWjZi2B+55BuOHJRt/QaciCR5xtuA eIRTK5oRIlSIRDFUYugXHCYIOc+ZUBpmg75O5eduXSn3AjWVF3RquL1OLnh3Hq4ehW atIoPDZyunOYjSJ598l4eXN7OCrEprDvh5EIXp7Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729991AbfG3Si5 (ORCPT ); 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