[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9ac94cda-3962-44d4-80e7-94555b104cf2@nvidia.com>
Date: Thu, 27 Mar 2025 12:22:12 -0400
From: Joel Fernandes <joelagnelf@...dia.com>
To: paulmck@...nel.org, Z qiang <qiang.zhang1211@...il.com>
Cc: rcu@...r.kernel.org, linux-kernel@...r.kernel.org, kernel-team@...a.com,
rostedt@...dmis.org
Subject: Re: [PATCH 5/9] rcutorture: Add tests for SRCU up/down reader
primitives
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
Powered by blists - more mailing lists