mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joel Fernandes <joelagnelf@nvidia.com>
To: paulmck@kernel.org, Z qiang <qiang.zhang1211@gmail.com>
Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-team@meta.com, rostedt@goodmis.org
Subject: Re: [PATCH 5/9] rcutorture: Add tests for SRCU up/down reader primitives
Date: Thu, 27 Mar 2025 12:22:12 -0400	[thread overview]
Message-ID: <9ac94cda-3962-44d4-80e7-94555b104cf2@nvidia.com> (raw)
In-Reply-To: <762ee713-a38f-49e5-aa4a-57e4a4da687c@paulmck-laptop>

Paul,

>> If rtorsu_hrt timer is still in timer_queue, invoke hrtimer_cancel() will
>> remove it from timerqueue and directly return, so the rcu_torture_updown_hrt()
>> will not be executed and the rtorsup->rtorsu_inuse cannot be set false.
>>
>> How about modifying it as follows:
>>
>> diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
>> index 04d7a2173b95..ecf3d3797f7e 100644
>> --- a/kernel/rcu/rcutorture.c
>> +++ b/kernel/rcu/rcutorture.c
>> @@ -2502,8 +2502,7 @@ static void rcu_torture_updown_cleanup(void)
>>         for (rtorsup = updownreaders; rtorsup <
>> &updownreaders[n_up_down]; rtorsup++) {
>>                 if (!smp_load_acquire(&rtorsup->rtorsu_inuse))
>>                         continue;
>> -               (void)hrtimer_cancel(&rtorsup->rtorsu_hrt);
>> -               if (WARN_ON_ONCE(rtorsup->rtorsu_inuse)) {
>> +               if (hrtimer_cancel(&rtorsup->rtorsu_hrt) ||
>> WARN_ON_ONCE(rtorsup->rtorsu_inuse)) {
>>
>> rcu_torture_one_read_end(&rtorsup->rtorsu_rtors, &rtorsup->rtorsu_trs,
>> -1);
>>                         WARN_ONCE(rtorsup->rtorsu_nups >=
>> rtorsup->rtorsu_ndowns, "%s: Up without matching down #%zu.\n",
>> __func__, rtorsup - updownreaders);
>>                         rtorsup->rtorsu_nups++;
> 
> Good eyes, thank you!  I have applied this fix with attribution.
Could you re-send the series, or should I apply the fix the patch myself? Or
provide the new patch inline here.

Thanks!

 - Joel


  reply	other threads:[~2025-03-27 16:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-10 18:38 [PATCH 0/9] RCU torture-test changes for v6.16 Paul E. McKenney
2025-03-10 18:38 ` [PATCH 1/9] rcutorture: Make srcu_lockdep.sh check kernel Kconfig Paul E. McKenney
2025-03-10 18:38 ` [PATCH 2/9] rcutorture: Make srcu_lockdep.sh check reader-conflict handling Paul E. McKenney
2025-03-10 18:38 ` [PATCH 3/9] rcutorture: Split out beginning and end from rcu_torture_one_read() Paul E. McKenney
2025-03-10 18:38 ` [PATCH 4/9] rcutorture: Make torture.sh --do-rt use CONFIG_PREEMPT_RT Paul E. McKenney
2025-03-10 18:38 ` [PATCH 5/9] rcutorture: Add tests for SRCU up/down reader primitives Paul E. McKenney
2025-03-27  3:26   ` Z qiang
2025-03-27 14:30     ` Paul E. McKenney
2025-03-27 16:22       ` Joel Fernandes [this message]
2025-03-27 16:48         ` Paul E. McKenney
2025-03-27 17:08           ` Joel Fernandes
2025-03-27 17:18             ` Paul E. McKenney
2025-03-10 18:38 ` [PATCH 6/9] rcutorture: Pull rcu_torture_updown() loop body into new function Paul E. McKenney
2025-03-10 18:38 ` [PATCH 7/9] rcutorture: Comment invocations of tick_dep_set_task() Paul E. McKenney
2025-03-10 18:38 ` [PATCH 8/9] rcutorture: Complain if an ->up_read() is delayed more than 10 seconds Paul E. McKenney
2025-03-10 18:38 ` [PATCH 9/9] rcutorture: Check for ->up_read() without matching ->down_read() Paul E. McKenney
2025-03-11  2:24 ` [PATCH 0/9] RCU torture-test changes for v6.16 Joel Fernandes

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=9ac94cda-3962-44d4-80e7-94555b104cf2@nvidia.com \
    --to=joelagnelf@nvidia.com \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=qiang.zhang1211@gmail.com \
    --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

all inboxes | Powered by JetHome®