Re: [PATCH 5/9] rcutorture: Add tests for SRCU up/down reader primitives
From: Joel Fernandes
Date: Thu Mar 27 2025 - 12:22:49 EST
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