linux/debian/patches/features/all/rt/hrtimer-account-for-migrate...

43 lines
1.5 KiB
Diff

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Thu, 14 Dec 2017 11:31:40 +0100
Subject: [PATCH] hrtimer: account for migrated timers
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
if the timer is enqueud on CPUX and we run on CPUY then we have to
cpu_base bits of the correct CPU. Not sure if this accounts for all the
pieces but it might be okay with the check we have in
hrtimer_check_target() (that we have nothing to do but just wait).
Reported-by: bert schulze <spambemyguest@googlemail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/time/hrtimer.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -775,16 +775,18 @@ static void hrtimer_reprogram(struct hrt
expires = 0;
if (timer->is_soft) {
- if (cpu_base->softirq_activated)
+ struct hrtimer_cpu_base *timer_cpu_base = base->cpu_base;
+
+ if (timer_cpu_base->softirq_activated)
return;
- if (!ktime_before(expires, cpu_base->softirq_expires_next))
+ if (!ktime_before(expires, timer_cpu_base->softirq_expires_next))
return;
- cpu_base->softirq_next_timer = timer;
- cpu_base->softirq_expires_next = expires;
+ timer_cpu_base->softirq_next_timer = timer;
+ timer_cpu_base->softirq_expires_next = expires;
- if (!ktime_before(expires, cpu_base->expires_next) ||
+ if (!ktime_before(expires, timer_cpu_base->expires_next) ||
!reprogram)
return;
}