]> git.baikalelectronics.ru Git - kernel.git/commit
timekeeping/vsyscall: Provide vdso_update_begin/end()
authorThomas Gleixner <tglx@linutronix.de>
Tue, 4 Aug 2020 15:01:23 +0000 (17:01 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 6 Aug 2020 08:57:30 +0000 (10:57 +0200)
commit415fea2aaba922a9c4fe6309ee02381ac29bc2d5
treee722934929bb2c9a7a9439211a20018c081a564a
parent90a3181d78bf6bf81b3c54228a28e95881c10803
timekeeping/vsyscall: Provide vdso_update_begin/end()

Architectures can have the requirement to add additional architecture
specific data to the VDSO data page which needs to be updated independent
of the timekeeper updates.

To protect these updates vs. concurrent readers and a conflicting update
through timekeeping, provide helper functions to make such updates safe.

vdso_update_begin() takes the timekeeper_lock to protect against a
potential update from timekeeper code and increments the VDSO sequence
count to signal data inconsistency to concurrent readers. vdso_update_end()
makes the sequence count even again to signal data consistency and drops
the timekeeper lock.

[ Sven: Add interrupt disable handling to the functions ]

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20200804150124.41692-3-svens@linux.ibm.com
include/vdso/vsyscall.h
kernel/time/timekeeping.c
kernel/time/timekeeping_internal.h
kernel/time/vsyscall.c