* [PATCH] rcu/torture replace wait_event with wait_event_interruptible
@ 2023-04-12 1:54 zhouzhouyi
2023-04-12 4:54 ` Paul E. McKenney
0 siblings, 1 reply; 3+ messages in thread
From: zhouzhouyi @ 2023-04-12 1:54 UTC (permalink / raw)
To: paulmck, rcu, linux-kernel, lance; +Cc: Zhouyi Zhou
From: Zhouyi Zhou <zhouzhouyi@gmail.com>
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.
Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
---
kernel/rcu/rcuscale.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/rcu/rcuscale.c b/kernel/rcu/rcuscale.c
index 91fb5905a008..b37eec94957c 100644
--- a/kernel/rcu/rcuscale.c
+++ b/kernel/rcu/rcuscale.c
@@ -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. */
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] rcu/torture replace wait_event with wait_event_interruptible
2023-04-12 1:54 [PATCH] rcu/torture replace wait_event with wait_event_interruptible zhouzhouyi
@ 2023-04-12 4:54 ` Paul E. McKenney
2023-04-12 5:09 ` Zhouyi Zhou
0 siblings, 1 reply; 3+ messages in thread
From: Paul E. McKenney @ 2023-04-12 4:54 UTC (permalink / raw)
To: zhouzhouyi; +Cc: rcu, linux-kernel, lance
On Wed, Apr 12, 2023 at 09:54:43AM +0800, zhouzhouyi@gmail.com wrote:
> From: Zhouyi Zhou <zhouzhouyi@gmail.com>
>
> 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.
>
> Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
> ---
> kernel/rcu/rcuscale.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/rcu/rcuscale.c b/kernel/rcu/rcuscale.c
> index 91fb5905a008..b37eec94957c 100644
> --- a/kernel/rcu/rcuscale.c
> +++ b/kernel/rcu/rcuscale.c
> @@ -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
> atomic_read(&n_kfree_scale_thread_ended) >= kfree_nrealthreads);
>
> smp_mb(); /* Wake before output. */
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] rcu/torture replace wait_event with wait_event_interruptible
2023-04-12 4:54 ` Paul E. McKenney
@ 2023-04-12 5:09 ` Zhouyi Zhou
0 siblings, 0 replies; 3+ messages in thread
From: Zhouyi Zhou @ 2023-04-12 5:09 UTC (permalink / raw)
To: paulmck; +Cc: rcu, linux-kernel, lance
On Wed, Apr 12, 2023 at 12:54 PM Paul E. McKenney <paulmck@kernel.org> wrote:
>
> On Wed, Apr 12, 2023 at 09:54:43AM +0800, zhouzhouyi@gmail.com wrote:
> > From: Zhouyi Zhou <zhouzhouyi@gmail.com>
> >
> > 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.
> >
> > Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
> > ---
> > kernel/rcu/rcuscale.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/kernel/rcu/rcuscale.c b/kernel/rcu/rcuscale.c
> > index 91fb5905a008..b37eec94957c 100644
> > --- a/kernel/rcu/rcuscale.c
> > +++ b/kernel/rcu/rcuscale.c
> > @@ -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.
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
>
> Thanx, Paul
>
> > atomic_read(&n_kfree_scale_thread_ended) >= kfree_nrealthreads);
> >
> > smp_mb(); /* Wake before output. */
> > --
> > 2.34.1
> >
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-04-12 5:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-12 1:54 [PATCH] rcu/torture replace wait_event with wait_event_interruptible zhouzhouyi
2023-04-12 4:54 ` Paul E. McKenney
2023-04-12 5:09 ` Zhouyi Zhou
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox