From: Bradley Morgan <brads@mainlining.org>
To: paulmck@kernel.org, "Paul E. McKenney" <paulmck@kernel.org>
Cc: boqun@kernel.org, frederic@kernel.org, include@grrlz.net,
jiangshanlai@gmail.com, joelagnelf@nvidia.com,
josh@joshtriplett.org, linux-kernel@vger.kernel.org,
mathieu.desnoyers@efficios.com, neeraj.upadhyay@kernel.org,
qiang.zhang@linux.dev, rcu@vger.kernel.org, rostedt@goodmis.org,
urezki@gmail.com
Subject: Re: [PATCH] hazptrtorture: Fix inverted sleep condition in do_pending kthread
Date: Sun, 06 Sep 2026 11:44:48 +0100 [thread overview]
Message-ID: <09BD5394-BF9D-46AF-BED3-CF16B7667716@mainlining.org> (raw)
In-Reply-To: <34021ed4-1a18-4cb6-8027-a8c919086ec0@paulmck-laptop>
On 5 September 2026 23:54:38 BST, "Paul E. McKenney" <paulmck@kernel.org>
wrote:
>On Sat, Sep 05, 2026 at 10:08:30PM +0100, Bradley Morgan wrote:
>> On 5 September 2026 21:40:28 BST, "Paul E. McKenney"
><paulmck@kernel.org>
>> wrote:
>> >On Fri, Sep 04, 2026 at 06:28:45PM +0100, Bradley Morgan wrote:
>> >> On 4 September 2026 17:00:22 BST, "Paul E. McKenney"
>> ><paulmck@kernel.org>
>> >> wrote:
>> >> >On Fri, Sep 04, 2026 at 09:01:05AM -0400, Mathieu Desnoyers wrote:
>> >> >> On 2026-08-03 20:03, Bradley Morgan wrote:
>> >> >> > The do_pending kthread never sleeps. Its supposed to.
>> >> >> > kthread_do_pending_ms sets the gap between cleanups, and the
>docs
>> >> >> > say so too. But the sleep sits behind torture_must_stop(), and
>> >thats
>> >> >> > false while the test runs. So the kthread never sleeps. It just
>> >loops.
>> >> >> > It drains the pending lists over and over, no pause, and burns a
>> >full
>> >> >> > CPU for the whole test.
>> >> >>
>> >> >> Paul, I just found this patch in my junk email folder. Maybe
>relevant
>> >> >> for you ?
>> >> >
>> >> >We got it in my -rcu tree:
>> >> >
>> >> >15b9fca2f5ce ("hazptrtorture: Fix inverted sleep condition in
>> >do_pending
>> >> >kthread")
>> >> >
>> >> >But I do appreciate your checking for missed patches, thank you!
>> >> >
>> >> > Thanx, Paul
>> >> >
>> >> >> Thanks,
>> >> >>
>> >> >> Mathieu
>> >> >>
>> >> >> >
>> >> >> > Flip the check. With !torture_must_stop() it sleeps for
>> >> >> > kthread_do_pending_ms between passes. When the test stops it
>does
>> >one
>> >> >> > last cleanup and exits. Nothing left to do, so no sleep needed
>> >then.
>> >> >> >
>> >> >> > Fixes: 94d2e93c222e ("hazptrtorture: Add kthread to release
>> >deferred
>> >> >hazard pointers")
>> >> >> > Signed-off-by: Bradley Morgan <include@grrlz.net>
>> >> >> > ---
>> >> >> > kernel/rcu/hazptrtorture.c | 2 +-
>> >> >> > 1 file changed, 1 insertion(+), 1 deletion(-)
>> >> >> >
>> >> >> > diff --git a/kernel/rcu/hazptrtorture.c
>> >b/kernel/rcu/hazptrtorture.c
>> >> >> > index 72aeb50668e9..7c8b5899fb01 100644
>> >> >> > --- a/kernel/rcu/hazptrtorture.c
>> >> >> > +++ b/kernel/rcu/hazptrtorture.c
>> >> >> > @@ -555,7 +555,7 @@ static int hazptr_torture_do_pending(void
>*arg)
>> >> >> > cpu = cpumask_next_wrap(cpu, cpu_possible_mask);
>> >> >> > hazptr_torture_do_one_pending(cpu, &rand);
>> >> >> > }
>> >> >> > - if (torture_must_stop())
>> >> >> > + if (!torture_must_stop())
>> >> >> > torture_hrtimeout_ms(kthread_do_pending_ms, USEC_PER_MSEC, &rand);
>> >> >> > // Omit stutter_wait() because this function needs to do cleanup.
>> >> >> > } while (!torture_must_stop());
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Mathieu Desnoyers
>> >> >> EfficiOS Inc.
>> >> >> https://www.efficios.com
>> >> >
>> >> >
>> >> Hi, new email.
>> >>
>> >> Could I ask where the heck hazptr is? Its not in next, would you
>like,
>> >> help???
>> >>
>> >> --- Thanks!
>> >>
>>
>>https://lore.kernel.org/all/EE579805-42F2-4C58-B752-F28779EEB717@grrlz.net/
>> >
>> >It is still in my -rcu tree.
>> >
>> >I would not say "no" to a fix for this issue:
>> >
>>
>>https://lore.kernel.org/all/EE579805-42F2-4C58-B752-F28779EEB717@grrlz.net/
>> >
>> >Once that is in place, I would be happy to put this back into -next.
>> >
>> >At some point, we will need to get rid of the concept of wildcard
>hazard
>> >pointers, as those end up instead emulating RCU, but I don't see that
>> >as an immediate obstacle.
>>
>> Well, okay, tell me more and I'll develop it.
>
>I must confess that I have not looked much into that bug report, so I
>don't have much more to tell.
No, like the getting rid of wildcard hazptrs?
>
> Thanx, Paul
>
>> --- Thanks!
>>
>https://lore.kernel.org/all/EE579805-42F2-4C58-B752-F28779EEB717@grrlz.net/
>>
--- Thanks!
https://lore.kernel.org/all/EE579805-42F2-4C58-B752-F28779EEB717@grrlz.net/
next prev parent reply other threads:[~2026-09-06 10:45 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 0:03 Bradley Morgan
2026-08-04 3:46 ` Paul E. McKenney
2026-09-04 13:01 ` Mathieu Desnoyers
2026-09-04 16:00 ` Paul E. McKenney
2026-09-04 17:28 ` Bradley Morgan
2026-09-05 20:40 ` Paul E. McKenney
2026-09-05 21:08 ` Bradley Morgan
2026-09-05 22:54 ` Paul E. McKenney
2026-09-06 10:44 ` Bradley Morgan [this message]
2026-09-06 13:09 ` Mathieu Desnoyers
2026-09-06 13:20 ` Bradley Morgan
2026-09-06 13:21 ` Bradley Morgan
2026-09-06 18:46 ` Paul E. McKenney
2026-09-06 18:56 ` Bradley Morgan
2026-09-06 23:16 ` Paul E. McKenney
2026-09-07 18:11 ` Bradley Morgan
2026-09-07 20:18 ` Paul E. McKenney
2026-09-07 20:41 ` Bradley Morgan
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=09BD5394-BF9D-46AF-BED3-CF16B7667716@mainlining.org \
--to=brads@mainlining.org \
--cc=boqun@kernel.org \
--cc=frederic@kernel.org \
--cc=include@grrlz.net \
--cc=jiangshanlai@gmail.com \
--cc=joelagnelf@nvidia.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=neeraj.upadhyay@kernel.org \
--cc=paulmck@kernel.org \
--cc=qiang.zhang@linux.dev \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=urezki@gmail.com \
/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
all inboxes | Powered by JetHome®