Skip to contentSkip to conversation

hrtimer: correct the logic for grab expiry lock

PATCH In review [email protected] 3 participants 4 messages Aug 12, 2020 – Aug 13, 2020 High-resolution timers, timer wheel, clockevents

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hrtimer: correct the logic for grab expiry lock

From: Zhantao Tang <[email protected]>

In commit: 47b6de0b7f22 ("hrtimer: Add a missing bracket and hide `migration_base' on !SMP") a inline function is_migration_base() is introduced. But
the logic of the hrtimer_grab_expiry_lock was changed.

This patch is to correct it.

---
 kernel/time/hrtimer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/time/hrtimer.c +1 -1
index b3adac366fd1..6b47e310c68e 100644
@@ -944,7 +944,7 @@ void hrtimer_grab_expiry_lock(const struct hrtimer *timer)
 {
 	struct hrtimer_clock_base *base = READ_ONCE(timer->base);
 
-	if (timer->is_soft && is_migration_base(base)) {
+	if (timer->is_soft && !is_migration_base(base)) {
 		spin_lock(&base->cpu_base->softirq_expiry_lock);
 		spin_unlock(&base->cpu_base->softirq_expiry_lock);
 	}
Signature · 1 line
2.17.1
#1 lore raw
Quoted 8 lines · On 12/08/2020 12.50, [email protected] wrote:

From: Zhantao Tang <[email protected]>

In commit: 47b6de0b7f22 ("hrtimer: Add a missing bracket and hide `migration_base' on !SMP") a inline function is_migration_base() is introduced. But
the logic of the hrtimer_grab_expiry_lock was changed.

This patch is to correct it.

Yup, same patch sent back in April, which also had a fixes tag for 5.2.

https://lore.kernel.org/lkml/[email protected]/

It got picked up for 4.19-rt, dunno why it wasn't for 5.2-rt.

Rasmus

#2 lore raw
Quoted 5 lines · On Wed, 12 Aug 2020 13:45:02 +0200 Rasmus Villemoes…

Yup, same patch sent back in April, which also had a fixes tag for 5.2.

https://lore.kernel.org/lkml/[email protected]/

It got picked up for 4.19-rt, dunno why it wasn't for 5.2-rt.

5.2-rt is no longer supported. The -rt trees follow mainline trees. When a mainline version is EOL so is the -rt version associated with it.

-- Steve

#3 lore raw
In reply to Rasmus Villemoes
Quoted 7 lines · Rasmus Villemoes
Quoted 6 lines · On 12/08/2020 12.50, [email protected] wrote:

From: Zhantao Tang <[email protected]>

In commit: 47b6de0b7f22 ("hrtimer: Add a missing bracket and hide `migration_base' on !SMP") a inline function is_migration_base() is introduced. But
the logic of the hrtimer_grab_expiry_lock was changed.

Quoted 7 lines
Quoted 2 lines

This patch is to correct it.

Yup, same patch sent back in April, which also had a fixes tag for 5.2.

https://lore.kernel.org/lkml/[email protected]/

It got picked up for 4.19-rt, dunno why it wasn't for 5.2-rt.

Yes, currently 5.2 rt kernel not fix the issue.

And I checked the 4.19 rt kernel, but  did not find the implementation of hrtimer_grab_expiry_lock().

It used hrtimer_wait_for_timer() and the logic is OK.

Thanks,

Zhantao

Quoted 2 lines

Rasmus