[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230323043935.1221184-10-boqun.feng@gmail.com>
Date: Wed, 22 Mar 2023 21:39:34 -0700
From: Boqun Feng <boqun.feng@...il.com>
To: rcu@...r.kernel.org
Cc: Davidlohr Bueso <dave@...olabs.net>,
"Paul E. McKenney" <paulmck@...nel.org>,
Josh Triplett <josh@...htriplett.org>,
Frederic Weisbecker <frederic@...nel.org>,
Neeraj Upadhyay <quic_neeraju@...cinc.com>,
Steven Rostedt <rostedt@...dmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Lai Jiangshan <jiangshanlai@...il.com>,
Joel Fernandes <joel@...lfernandes.org>,
Shuah Khan <shuah@...nel.org>,
Bhaskar Chowdhury <unixbhaskar@...il.com>,
Boqun Feng <boqun.feng@...il.com>,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
kernel test robot <yujie.liu@...el.com>,
Liam Howlett <liam.howlett@...cle.com>
Subject: [PATCH rcu v2 09/10] rcuscale: Move shutdown from wait_event() to wait_event_idle()
From: "Paul E. McKenney" <paulmck@...nel.org>
The rcu_scale_shutdown() and kfree_scale_shutdown() kthreads/functions
use wait_event() to wait for the rcuscale test to complete. However,
each updater thread in such a test waits for at least 100 grace periods.
If each grace period takes more than 1.2 seconds, which is long, but
not insanely so, this can trigger the hung-task timeout.
This commit therefore replaces those wait_event() calls with calls to
wait_event_idle(), which do not trigger the hung-task timeout.
Reported-by: kernel test robot <yujie.liu@...el.com>
Reported-by: Liam Howlett <liam.howlett@...cle.com>
Signed-off-by: Paul E. McKenney <paulmck@...nel.org>
Tested-by: Yujie Liu <yujie.liu@...el.com>
Signed-off-by: Boqun Feng <boqun.feng@...il.com>
---
kernel/rcu/rcuscale.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/kernel/rcu/rcuscale.c b/kernel/rcu/rcuscale.c
index 91fb5905a008..4120f94030c3 100644
--- a/kernel/rcu/rcuscale.c
+++ b/kernel/rcu/rcuscale.c
@@ -631,8 +631,7 @@ static int compute_real(int n)
static int
rcu_scale_shutdown(void *arg)
{
- wait_event(shutdown_wq,
- atomic_read(&n_rcu_scale_writer_finished) >= nrealwriters);
+ wait_event_idle(shutdown_wq, atomic_read(&n_rcu_scale_writer_finished) >= nrealwriters);
smp_mb(); /* Wake before output. */
rcu_scale_cleanup();
kernel_power_off();
@@ -771,8 +770,8 @@ kfree_scale_cleanup(void)
static int
kfree_scale_shutdown(void *arg)
{
- wait_event(shutdown_wq,
- atomic_read(&n_kfree_scale_thread_ended) >= kfree_nrealthreads);
+ wait_event_idle(shutdown_wq,
+ atomic_read(&n_kfree_scale_thread_ended) >= kfree_nrealthreads);
smp_mb(); /* Wake before output. */
--
2.38.1
Powered by blists - more mailing lists