rcu/torture replace wait_event with wait_event_interruptible
Subsystems (2)
PATCH 1/1 rcu/torture replace wait_event with wait_event_interruptible
From: Zhouyi Zhou <[email protected]>
In kfree_rcu_test, kfree_scale_shutdown will be detected as hung task if kfree_loops is too big. Replace wait_event with wait_event_interruptible to avoid false positive.
Tested in the PPC VM of Open Source Lab of Oregon State University.
--- kernel/rcu/rcuscale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/rcu/rcuscale.c +1 -1
@@ -771,7 +771,7 @@ kfree_scale_cleanup(void)static int kfree_scale_shutdown (void *arg) { -wait_event (shutdown_wq, +wait_event_interruptible (shutdown_wq,atomic_read (&n_kfree_scale_thread_ended) >= kfree_nrealthreads);smp_mb ();/* Wake before output. */
Signature · 1 line
2.34.1
Paul E. McKenney
maintainerQuoted 18 lines · On Wed, Apr 12, 2023 at 09:54:43AM +0800, [email protected] wrote:
From: Zhouyi Zhou <[email protected]>
In
kfree_rcu_test,kfree_scale_shutdownwill be detected as hung task ifkfree_loopsis too big. Replacewait_eventwithwait_event_interruptibleto avoid false positive.Tested in the PPC VM of Open Source Lab of Oregon State University.
Signed-off-by Zhouyi Zhou <[email protected]>--- kernel/rcu/rcuscale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/rcu/rcuscale.c +0
-0
kernel/rcu/rcuscale.c kfree_scale_cleanup(void) · line 774
Quoted 5 lines
kernel/rcu/rcuscale.c +1
-1@@ -771,7 +771,7 @@ kfree_scale_cleanup(void)static int kfree_scale_shutdown (void *arg) { - wait_event(shutdown_wq, + wait_event_interruptible(shutdown_wq,
Good catch!!!
Would wait_event_idle() work in this case? The _interruptible() variant indicates that wakeups due to things like POSIX signals is permitted.
Thanx, Paul
Quoted 6 lines
kernel/rcu/rcuscale.c +0
-0atomic_read(&n_kfree_scale_thread_ended) >= kfree_nrealthreads);smp_mb ();/* Wake before output. */ Signature · 1 line
2.34.1
Quoted 28 lines · Paul E. McKenney
Quoted 18 lines · On Wed, Apr 12, 2023 at 09:54:43AM +0800, [email protected] wrote:
From: Zhouyi Zhou <[email protected]>
In
kfree_rcu_test,kfree_scale_shutdownwill be detected as hung task ifkfree_loopsis too big. Replacewait_eventwithwait_event_interruptibleto avoid false positive.Tested in the PPC VM of Open Source Lab of Oregon State University.
Signed-off-by Zhouyi Zhou <[email protected]>--- kernel/rcu/rcuscale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/rcu/rcuscale.c +0
-0kernel/rcu/rcuscale.c kfree_scale_cleanup(void) · line 774
Quoted 5 lines
kernel/rcu/rcuscale.c +1
-1@@ -771,7 +771,7 @@ kfree_scale_cleanup(void)static int kfree_scale_shutdown (void *arg) { - wait_event(shutdown_wq, + wait_event_interruptible(shutdown_wq,Good catch!!!
Quoted 3 lines
Would
wait_event_idle()work in this case? The_interruptible()variant indicates that wakeups due to things like POSIX signals is permitted.
Thank Paul for your guidance and encouragement!
I will perform a new round of rcu torture test, after this is done, I will resend the modified version.
Thanks ;-)
Zhouyi
Quoted 9 lines
Thanx, Paul
Quoted 6 lines
kernel/rcu/rcuscale.c +0
-1atomic_read(&n_kfree_scale_thread_ended) >= kfree_nrealthreads);smp_mb ();/* Wake before output. */ --2.34.1