From: "Paul E. McKenney" <paulmck@kernel.org>
To: rcu@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com,
rostedt@goodmis.org,
"Joel Fernandes (Google)" <joel@joelfernandes.org>,
"Paul E . McKenney" <paulmck@kernel.org>
Subject: [PATCH rcu 10/16] rcu/rcutorture: Use call_rcu_hurry() where needed
Date: Wed, 30 Nov 2022 10:13:19 -0800 [thread overview]
Message-ID: <20221130181325.1012760-10-paulmck@kernel.org> (raw)
In-Reply-To: <20221130181316.GA1012431@paulmck-ThinkPad-P17-Gen-1>
From: "Joel Fernandes (Google)" <joel@joelfernandes.org>
call_rcu() changes to save power will change the behavior of rcutorture
tests. Use the call_rcu_hurry() API instead which reverts to the old
behavior.
[ paulmck: Apply s/call_rcu_flush/call_rcu_hurry/ feedback from Tejun Heo. ]
Reported-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
kernel/rcu/rcutorture.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 503c2aa845a4a..2226f86f54f78 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -510,7 +510,7 @@ static unsigned long rcu_no_completed(void)
static void rcu_torture_deferred_free(struct rcu_torture *p)
{
- call_rcu(&p->rtort_rcu, rcu_torture_cb);
+ call_rcu_hurry(&p->rtort_rcu, rcu_torture_cb);
}
static void rcu_sync_torture_init(void)
@@ -551,7 +551,7 @@ static struct rcu_torture_ops rcu_ops = {
.start_gp_poll_exp_full = start_poll_synchronize_rcu_expedited_full,
.poll_gp_state_exp = poll_state_synchronize_rcu,
.cond_sync_exp = cond_synchronize_rcu_expedited,
- .call = call_rcu,
+ .call = call_rcu_hurry,
.cb_barrier = rcu_barrier,
.fqs = rcu_force_quiescent_state,
.stats = NULL,
@@ -848,7 +848,7 @@ static void rcu_tasks_torture_deferred_free(struct rcu_torture *p)
static void synchronize_rcu_mult_test(void)
{
- synchronize_rcu_mult(call_rcu_tasks, call_rcu);
+ synchronize_rcu_mult(call_rcu_tasks, call_rcu_hurry);
}
static struct rcu_torture_ops tasks_ops = {
@@ -3388,13 +3388,13 @@ static void rcu_test_debug_objects(void)
/* Try to queue the rh2 pair of callbacks for the same grace period. */
preempt_disable(); /* Prevent preemption from interrupting test. */
rcu_read_lock(); /* Make it impossible to finish a grace period. */
- call_rcu(&rh1, rcu_torture_leak_cb); /* Start grace period. */
+ call_rcu_hurry(&rh1, rcu_torture_leak_cb); /* Start grace period. */
local_irq_disable(); /* Make it harder to start a new grace period. */
- call_rcu(&rh2, rcu_torture_leak_cb);
- call_rcu(&rh2, rcu_torture_err_cb); /* Duplicate callback. */
+ call_rcu_hurry(&rh2, rcu_torture_leak_cb);
+ call_rcu_hurry(&rh2, rcu_torture_err_cb); /* Duplicate callback. */
if (rhp) {
- call_rcu(rhp, rcu_torture_leak_cb);
- call_rcu(rhp, rcu_torture_err_cb); /* Another duplicate callback. */
+ call_rcu_hurry(rhp, rcu_torture_leak_cb);
+ call_rcu_hurry(rhp, rcu_torture_err_cb); /* Another duplicate callback. */
}
local_irq_enable();
rcu_read_unlock();
--
2.31.1.189.g2e36527f23
next prev parent reply other threads:[~2022-11-30 18:13 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-30 18:13 [PATCH v3 rcu 0/16] Lazy call_rcu() updates for v6.2 Paul E. McKenney
2022-11-30 18:13 ` [PATCH rcu 01/16] rcu: Simplify rcu_init_nohz() cpumask handling Paul E. McKenney
2022-11-30 18:13 ` [PATCH rcu 02/16] rcu: Fix late wakeup when flush of bypass cblist happens Paul E. McKenney
2022-11-30 18:13 ` [PATCH rcu 03/16] rcu: Fix missing nocb gp wake on rcu_barrier() Paul E. McKenney
2022-11-30 18:13 ` [PATCH rcu 04/16] rcu: Make call_rcu() lazy to save power Paul E. McKenney
2022-11-30 18:13 ` [PATCH rcu 05/16] rcu: Refactor code a bit in rcu_nocb_do_flush_bypass() Paul E. McKenney
2022-11-30 18:13 ` [PATCH rcu 06/16] rcu: Shrinker for lazy rcu Paul E. McKenney
2022-11-30 18:13 ` [PATCH rcu 07/16] rcuscale: Add laziness and kfree tests Paul E. McKenney
2022-11-30 18:13 ` [PATCH rcu 08/16] rcu/sync: Use call_rcu_hurry() instead of call_rcu Paul E. McKenney
2022-11-30 18:13 ` [PATCH rcu 09/16] rcu/rcuscale: Use call_rcu_hurry() for async reader test Paul E. McKenney
2022-11-30 18:13 ` Paul E. McKenney [this message]
2022-11-30 18:13 ` [PATCH rcu 11/16] scsi/scsi_error: Use call_rcu_hurry() instead of call_rcu() Paul E. McKenney
2022-11-30 18:13 ` [PATCH rcu 12/16] percpu-refcount: Use call_rcu_hurry() for atomic switch Paul E. McKenney
2022-11-30 18:19 ` Joel Fernandes
2022-11-30 19:43 ` Tejun Heo
2022-11-30 21:44 ` Paul E. McKenney
2022-11-30 18:13 ` [PATCH rcu 13/16] workqueue: Make queue_rcu_work() use call_rcu_hurry() Paul E. McKenney
2022-11-30 18:18 ` Joel Fernandes
2022-11-30 19:43 ` Tejun Heo
2022-11-30 18:13 ` [PATCH rcu 14/16] rxrpc: Use call_rcu_hurry() instead of call_rcu() Paul E. McKenney
2022-11-30 18:16 ` Joel Fernandes
2022-11-30 18:37 ` Eric Dumazet
2022-11-30 21:45 ` Paul E. McKenney
2022-11-30 21:49 ` Steven Rostedt
2022-11-30 22:00 ` Paul E. McKenney
2022-11-30 19:09 ` David Howells
2022-11-30 19:20 ` Joel Fernandes
2022-11-30 21:43 ` Paul E. McKenney
2022-11-30 22:06 ` Joel Fernandes
2022-11-30 20:12 ` Paul E. McKenney
2022-11-30 22:47 ` Joel Fernandes
2022-11-30 23:05 ` David Howells
2022-11-30 23:15 ` Joel Fernandes
2023-03-11 17:46 ` Joel Fernandes
2022-11-30 18:13 ` [PATCH rcu 15/16] net: Use call_rcu_hurry() for dst_release() Paul E. McKenney
2022-11-30 18:16 ` Joel Fernandes
2022-11-30 18:39 ` Eric Dumazet
2022-11-30 18:50 ` Joel Fernandes
2022-11-30 21:40 ` Paul E. McKenney
2022-11-30 18:13 ` [PATCH rcu 16/16] net: devinet: Reduce refcount before grace period 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=20221130181325.1012760-10-paulmck@kernel.org \
--to=paulmck@kernel.org \
--cc=joel@joelfernandes.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.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