linux/kernel/time
Daniel Thompson 8710e91402 timers, sched/clock: Match scope of read and write seqcounts
Currently the scope of the raw_write_seqcount_begin/end() in
sched_clock_register() far exceeds the scope of the read section
in sched_clock(). This gives the impression of safety during
cursory review but achieves little.

Note that this is likely to be a latent issue at present because
sched_clock_register() is typically called before we enable
interrupts, however the issue does risk bugs being needlessly
introduced as the code evolves.

This patch fixes the problem by increasing the scope of the read
locking performed by sched_clock() to cover all data modified by
sched_clock_register.

We also improve clarity by moving writes to struct clock_data
that do not impact sched_clock() outside of the critical
section.

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
[ Reworked it slightly to apply to tip/timers/core]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Link: http://lkml.kernel.org/r/1427397806-20889-2-git-send-email-john.stultz@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-03-27 08:33:56 +01:00
..
alarmtimer.c all arches, signal: move restart_block to struct task_struct 2015-02-12 18:54:12 -08:00
clockevents.c clockevents: Introduce mode specific callbacks 2015-02-18 15:16:23 +01:00
clocksource.c clocksource: Rename __clocksource_updatefreq_*() to __clocksource_update_freq_*() 2015-03-13 08:07:08 +01:00
hrtimer.c all arches, signal: move restart_block to struct task_struct 2015-02-12 18:54:12 -08:00
itimer.c
jiffies.c clocksource: Mostly kill clocksource_register() 2015-03-13 08:07:06 +01:00
Kconfig
Makefile time: move the timecounter/cyclecounter code into its own file. 2014-12-30 18:29:25 -05:00
ntp_internal.h
ntp.c ntp: Fixup adjtimex freq validation on 32-bit systems 2015-02-18 14:50:10 +01:00
posix-clock.c
posix-cpu-timers.c all arches, signal: move restart_block to struct task_struct 2015-02-12 18:54:12 -08:00
posix-timers.c posix-timers: Fix stack info leak in timer_create() 2014-10-25 10:43:15 +02:00
sched_clock.c timers, sched/clock: Match scope of read and write seqcounts 2015-03-27 08:33:56 +01:00
test_udelay.c time: Rename udelay_test.c to test_udelay.c 2014-11-21 11:59:55 -08:00
tick-broadcast-hrtimer.c
tick-broadcast.c time: Replace __get_cpu_var uses 2014-08-26 13:45:44 -04:00
tick-common.c PM / sleep: Make it possible to quiesce timers during suspend-to-idle 2015-02-15 19:40:09 +01:00
tick-internal.h nohz: Move nohz full init call to tick init 2014-09-13 18:34:44 +02:00
tick-oneshot.c time: Replace __get_cpu_var uses 2014-08-26 13:45:44 -04:00
tick-sched.c time: use %*pb[l] to print bitmaps including cpumasks and nodemasks 2015-02-13 21:21:37 -08:00
time.c Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-01-25 17:47:34 -08:00
timeconst.bc
timeconv.c
timecounter.c timecounter: keep track of accumulated fractional nanoseconds 2014-12-30 18:29:27 -05:00
timekeeping_debug.c
timekeeping_internal.h
timekeeping.c timekeeping: Add warnings when overflows or underflows are observed 2015-03-13 08:07:05 +01:00
timekeeping.h PM / sleep: Make it possible to quiesce timers during suspend-to-idle 2015-02-15 19:40:09 +01:00
timer_list.c clockevents: Introduce mode specific callbacks 2015-02-18 15:16:23 +01:00
timer_stats.c
timer.c rcu: Remove "cpu" argument to rcu_check_callbacks() 2014-11-03 19:20:11 -08:00