mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Chen, Yu C" <yu.c.chen@intel.com>
To: kernel test robot <oliver.sang@intel.com>,
	Andrea Righi <arighi@nvidia.com>
Cc: <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 09:53:22 +0800	[thread overview]
Message-ID: <9e921b33-4029-4a75-82f2-ad2891e9d3d5@intel.com> (raw)
In-Reply-To: <202605232131.cfcd45a2-lkp@intel.com>

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]

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  1:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-23 13:27 kernel test robot
2026-05-25  1:53 ` Chen, Yu C [this message]
2026-05-25  4:24   ` Andrea Righi
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=9e921b33-4029-4a75-82f2-ad2891e9d3d5@intel.com \
    --to=yu.c.chen@intel.com \
    --cc=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 \
    /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

Powered by JetHome