The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andrea Righi <arighi@nvidia.com>
To: "Chen, Yu C" <yu.c.chen@intel.com>
Cc: kernel test robot <oliver.sang@intel.com>,
	oe-lkp@lists.linux.dev, lkp@intel.com,
	linux-kernel@vger.kernel.org, x86@kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	K Prateek Nayak <kprateek.nayak@amd.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	aubrey.li@linux.intel.com
Subject: Re: [tip:sched/core] [sched/fair] c9d93a73ce: WARNING:suspicious_RCU_usage
Date: Mon, 25 May 2026 06:24:30 +0200	[thread overview]
Message-ID: <ahPO_v4_lYGagmcW@gpd4> (raw)
In-Reply-To: <9e921b33-4029-4a75-82f2-ad2891e9d3d5@intel.com>

Hello,

On Mon, May 25, 2026 at 09:53:22AM +0800, Chen, Yu C wrote:
> On 5/23/2026 9:27 PM, kernel test robot wrote:
> 
> > 
> > [  102.159951][   T23]
> > [  102.160730][   T23] =============================
> > [  102.162072][   T23] WARNING: suspicious RCU usage
> > [  102.163398][   T23] 7.1.0-rc2-00011-gc9d93a73ce87 #1 Not tainted
> > [  102.165064][   T23] -----------------------------
> > [  102.167687][   T23] kernel/sched/fair.c:12793 suspicious rcu_dereference_check() usage!
> > [  102.169994][   T23]

This should be fixed by
https://lore.kernel.org/all/20260522092523.2046095-1-arighi@nvidia.com/

Thanks,
-Andrea

> 
> sched_cpu_deactivate() does not hold RCU read lock, nor are
> preemption/IRQs/BH disabled,
> how about this:
>  static void set_cpu_sd_state_busy(int cpu)
>  {
>         struct sched_domain *sd;
> -       sd = rcu_dereference_all(per_cpu(sd_llc, cpu));
> +       sd = rcu_dereference_all_check(per_cpu(sd_llc, cpu),
> +                                      lockdep_is_cpus_held());
> 
>         /*
>          * sd->nohz_idle only pairs with nr_busy_cpus on sd->shared; if this
> @@ -12815,7 +12817,8 @@ void nohz_balance_exit_idle(struct rq *rq)
>  static void set_cpu_sd_state_idle(int cpu)
>  {
>         struct sched_domain *sd;
> -       sd = rcu_dereference_all(per_cpu(sd_llc, cpu));
> +       sd = rcu_dereference_all_check(per_cpu(sd_llc, cpu),
> +                                      lockdep_is_cpus_held());
> 
>         /* See set_cpu_sd_state_busy(): nohz_idle is only used with
> sd->shared. */
>         if (!sd || !sd->shared || sd->nohz_idle)

  reply	other threads:[~2026-05-25  4:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-23 13:27 [tip:sched/core] [sched/fair] c9d93a73ce: WARNING:suspicious_RCU_usage kernel test robot
2026-05-25  1:53 ` Chen, Yu C
2026-05-25  4:24   ` Andrea Righi [this message]
2026-05-25  8:08     ` Chen, Yu C

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=ahPO_v4_lYGagmcW@gpd4 \
    --to=arighi@nvidia.com \
    --cc=aubrey.li@linux.intel.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-lkp@lists.linux.dev \
    --cc=oliver.sang@intel.com \
    --cc=peterz@infradead.org \
    --cc=vincent.guittot@linaro.org \
    --cc=x86@kernel.org \
    --cc=yu.c.chen@intel.com \
    /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