]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - kernel/time/tick-common.c
timekeeping: Split jiffies seqlock
authorThomas Gleixner <tglx@linutronix.de>
Sat, 21 Mar 2020 11:25:58 +0000 (12:25 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Sat, 21 Mar 2020 15:00:23 +0000 (16:00 +0100)
commite5d4d1756b07d9490a0269a9e68c1e05ee1feb9b
tree27a6cf91053169846adab85b04a84cb9e763d2fb
parent919e9e6395cfac23b7e71ed88930367459055daf
timekeeping: Split jiffies seqlock

seqlock consists of a sequence counter and a spinlock_t which is used to
serialize the writers. spinlock_t is substituted by a "sleeping" spinlock
on PREEMPT_RT enabled kernels which breaks the usage in the timekeeping
code as the writers are executed in hard interrupt and therefore
non-preemptible context even on PREEMPT_RT.

The spinlock in seqlock cannot be unconditionally replaced by a
raw_spinlock_t as many seqlock users have nesting spinlock sections or
other code which is not suitable to run in truly atomic context on RT.

Instead of providing a raw_seqlock API for a single use case, open code the
seqlock for the jiffies use case and implement it with a raw_spinlock_t and
a sequence counter.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200321113242.120587764@linutronix.de
kernel/time/jiffies.c
kernel/time/tick-common.c
kernel/time/tick-sched.c
kernel/time/timekeeping.c
kernel/time/timekeeping.h