mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Liu, Yujie" <yujie.liu@intel.com>
To: "paulmck@kernel.org" <paulmck@kernel.org>, lkp <lkp@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"oe-kbuild-all@lists.linux.dev" <oe-kbuild-all@lists.linux.dev>
Subject: Re: [paulmck-rcu:dev.2023.03.17a 33/38] kernel/rcu/tasks.h:140:20: warning: 'tasks_rcu_exit_srcu' defined but not used
Date: Tue, 21 Mar 2023 02:49:08 +0000	[thread overview]
Message-ID: <9c716b77dd0743089a40f933ccdcbd57222e21f4.camel@intel.com> (raw)
In-Reply-To: <be0bf772-bac1-4a18-a46a-922a93093314@paulmck-laptop>

Hi Paul,

On Sun, 2023-03-19 at 17:33 -0700, Paul E. McKenney wrote:
> On Sun, Mar 19, 2023 at 03:05:43PM +0800, kernel test robot wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev.2023.03.17a
> > head:   19d218a4b125a4dce12eb88097a9c55f7126ce8c
> > commit: 61eea4556e8cf92d4c9b483110a679d2652aa451 [33/38] srcu: Move work-scheduling fields from srcu_struct to srcu_usage
> > config: x86_64-kexec (https://download.01.org/0day-ci/archive/20230319/202303191536.XzMSyzTl-lkp@intel.com/config)
> > compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
> > reproduce (this is a W=1 build):
> >         # https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git/commit/?id=61eea4556e8cf92d4c9b483110a679d2652aa451
> >         git remote add paulmck-rcu https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> >         git fetch --no-tags paulmck-rcu dev.2023.03.17a
> >         git checkout 61eea4556e8cf92d4c9b483110a679d2652aa451
> >         # save the config file
> >         mkdir build_dir && cp config build_dir/.config
> >         make W=1 O=build_dir ARCH=x86_64 olddefconfig
> >         make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash kernel/
> > 
> > If you fix the issue, kindly add following tag where applicable
> > > Reported-by: kernel test robot <lkp@intel.com>
> > > Link: https://lore.kernel.org/oe-kbuild-all/202303191536.XzMSyzTl-lkp@intel.com/
> > 
> > All warnings (new ones prefixed by >>):
> > 
> >    In file included from include/linux/srcu.h:49,
> >                     from include/linux/notifier.h:16,
> >                     from arch/x86/include/asm/uprobes.h:13,
> >                     from include/linux/uprobes.h:49,
> >                     from include/linux/mm_types.h:16,
> >                     from include/linux/sched/signal.h:13,
> >                     from kernel/rcu/update.c:26:
> > > > kernel/rcu/tasks.h:140:20: warning: 'tasks_rcu_exit_srcu' defined but not used [-Wunused-variable]
> >      140 | DEFINE_STATIC_SRCU(tasks_rcu_exit_srcu);
> >          |                    ^~~~~~~~~~~~~~~~~~~
> >    include/linux/srcutree.h:184:38: note: in definition of macro '__DEFINE_SRCU'
> >      184 |         is_static struct srcu_struct name =                                                     \
> >          |                                      ^~~~
> >    kernel/rcu/tasks.h:140:1: note: in expansion of macro 'DEFINE_STATIC_SRCU'
> >      140 | DEFINE_STATIC_SRCU(tasks_rcu_exit_srcu);
> >          | ^~~~~~~~~~~~~~~~~~
> 
> Good catch, thank you!
> 
> Does the patch shown below fix this?

We've tested the patch and the build warning is fixed by it. Thanks.

--
Best Regards,
Yujie

>                                                         Thanx, Paul
> 
> ------------------------------------------------------------------------
> 
> commit a9b8406e51603238941dbc6fa1437f8915254ebb
> Author: Paul E. McKenney <paulmck@kernel.org>
> Date:   Sun Mar 19 17:29:20 2023 -0700
> 
>     rcu-tasks: Fix warning for unused tasks_rcu_exit_srcu
>     
>     The tasks_rcu_exit_srcu variable is used only by kernels built
>     with CONFIG_TASKS_RCU=y, but is defined for all kernesl with
>     CONFIG_TASKS_RCU_GENERIC=y.  Therefore, in kernels built with
>     CONFIG_TASKS_RCU_GENERIC=y but CONFIG_TASKS_RCU=n, this gives
>     a "defined but not used" warning.
>     
>     This commit therefore moves this variable under CONFIG_TASKS_RCU
>     
>     Link: https://lore.kernel.org/oe-kbuild-all/202303191536.XzMSyzTl-lkp@intel.com/
>     Reported-by: kernel test robot <lkp@intel.com>
>     Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> 
> diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
> index baf7ec178155..85a874d4166b 100644
> --- a/kernel/rcu/tasks.h
> +++ b/kernel/rcu/tasks.h
> @@ -136,10 +136,10 @@ static struct rcu_tasks rt_name =                                                 \
>         .kname = #rt_name,                                                              \
>  }
>  
> +#ifdef CONFIG_TASKS_RCU
>  /* Track exiting tasks in order to allow them to be waited for. */
>  DEFINE_STATIC_SRCU(tasks_rcu_exit_srcu);
>  
> -#ifdef CONFIG_TASKS_RCU
>  /* Report delay in synchronize_srcu() completion in rcu_tasks_postscan(). */
>  static void tasks_rcu_exit_srcu_stall(struct timer_list *unused);
>  static DEFINE_TIMER(tasks_rcu_exit_srcu_stall_timer, tasks_rcu_exit_srcu_stall);
> 


  reply	other threads:[~2023-03-21  2:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-19  7:05 kernel test robot
2023-03-19 17:26 ` Paul E. McKenney
2023-03-20  0:33 ` Paul E. McKenney
2023-03-21  2:49   ` Liu, Yujie [this message]
2023-03-21  4:18     ` Paul E. McKenney
2023-03-21  6:16       ` Liu, Yujie
2023-03-21 15:52         ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9c716b77dd0743089a40f933ccdcbd57222e21f4.camel@intel.com \
    --to=yujie.liu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=paulmck@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®