RCU Archive mirror
 help / color / mirror / Atom feed
From: Zqiang <qiang.zhang1211@gmail.com>
To: paulmck@kernel.org, joel@joelfernandes.org
Cc: qiang.zhang1211@gmail.com, linux-kernel@vger.kernel.org,
	rcu@vger.kernel.org
Subject: [PATCH] rcutorture: Traverse possible cpu to set maxcpu in rcu_nocb_toggle()
Date: Thu, 24 Aug 2023 16:42:06 +0800	[thread overview]
Message-ID: <20230824084206.22844-1-qiang.zhang1211@gmail.com> (raw)

Currently, the maxcpu is set by traversing online CPUs, however, if
the rcutorture.onoff_holdoff is set zero and onoff_interval is set
non-zero, and the some CPUs with larger cpuid has been offline before
setting maxcpu, for these CPUs, even if they are online again, also
cannot be offload or deoffload.

This commit therefore use for_each_possible_cpu() instead of
for_each_online_cpu() in rcu_nocb_toggle().

Signed-off-by: Zqiang <qiang.zhang1211@gmail.com>
---
 kernel/rcu/rcutorture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index a58372bdf0c1..b75d0fe558ce 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -2131,7 +2131,7 @@ static int rcu_nocb_toggle(void *arg)
 	VERBOSE_TOROUT_STRING("rcu_nocb_toggle task started");
 	while (!rcu_inkernel_boot_has_ended())
 		schedule_timeout_interruptible(HZ / 10);
-	for_each_online_cpu(cpu)
+	for_each_possible_cpu(cpu)
 		maxcpu = cpu;
 	WARN_ON(maxcpu < 0);
 	if (toggle_interval > ULONG_MAX)
-- 
2.17.1


             reply	other threads:[~2023-08-24  8:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24  8:42 Zqiang [this message]
2023-08-24  8:59 ` [PATCH] rcutorture: Traverse possible cpu to set maxcpu in rcu_nocb_toggle() Z qiang
2023-08-24 13:21 ` Paul E. McKenney
2023-08-25  2:28   ` Z qiang
2023-08-26  1:29     ` Paul E. McKenney
2023-08-26  6:13       ` Z qiang
2023-08-26 13:06         ` Paul E. McKenney
2023-08-28 15:17           ` Frederic Weisbecker
2023-08-28 21:51             ` Joel Fernandes
2023-08-29  9:24               ` Frederic Weisbecker
2023-08-29 10:12                 ` Joel Fernandes
2023-08-29 12:38                 ` Paul E. McKenney
2023-09-01 14:56                   ` Paul E. McKenney
  -- strict thread matches above, loose matches on Subject: below --
2023-08-24  8:41 Zqiang

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=20230824084206.22844-1-qiang.zhang1211@gmail.com \
    --to=qiang.zhang1211@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=rcu@vger.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).