]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
time/sched_clock: Expire timer in hardirq context
authorAhmed S. Darwish <a.darwish@linutronix.de>
Mon, 9 Mar 2020 18:15:29 +0000 (18:15 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Apr 2020 14:11:54 +0000 (16:11 +0200)
commit4200816766ce1f1833b73d867622f79d5edd8232
tree60d4435e19fa7909f36d54c5863b2577930a35a9
parent81db3b74a5236b351dd766270ce6d68434243f82
time/sched_clock: Expire timer in hardirq context

[ Upstream commit 2c8bd58812ee3dbf0d78b566822f7eacd34bdd7b ]

To minimize latency, PREEMPT_RT kernels expires hrtimers in preemptible
softirq context by default. This can be overriden by marking the timer's
expiry with HRTIMER_MODE_HARD.

sched_clock_timer is missing this annotation: if its callback is preempted
and the duration of the preemption exceeds the wrap around time of the
underlying clocksource, sched clock will get out of sync.

Mark the sched_clock_timer for expiry in hard interrupt context.

Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20200309181529.26558-1-a.darwish@linutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/time/sched_clock.c