Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer fixes from Ingo Molnar:
"Three fixes: fix link failure on Alpha, fix a Sparse warning and
annotate/robustify a lockless access in the NOHZ code"

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
tick/sched: Annotate lockless access to last_jiffies_update
lib/vdso: Make __cvdso_clock_getres() static
time/posix-stubs: Provide compat itimer supoprt for alpha

+13 -5
+3
kernel/time/posix-stubs.c
··· 151 151 152 152 #ifdef CONFIG_COMPAT 153 153 COMPAT_SYS_NI(timer_create); 154 + #endif 155 + 156 + #if defined(CONFIG_COMPAT) || defined(CONFIG_ALPHA) 154 157 COMPAT_SYS_NI(getitimer); 155 158 COMPAT_SYS_NI(setitimer); 156 159 #endif
+9 -5
kernel/time/tick-sched.c
··· 58 58 59 59 /* 60 60 * Do a quick check without holding jiffies_lock: 61 + * The READ_ONCE() pairs with two updates done later in this function. 61 62 */ 62 - delta = ktime_sub(now, last_jiffies_update); 63 + delta = ktime_sub(now, READ_ONCE(last_jiffies_update)); 63 64 if (delta < tick_period) 64 65 return; 65 66 ··· 71 70 if (delta >= tick_period) { 72 71 73 72 delta = ktime_sub(delta, tick_period); 74 - last_jiffies_update = ktime_add(last_jiffies_update, 75 - tick_period); 73 + /* Pairs with the lockless read in this function. */ 74 + WRITE_ONCE(last_jiffies_update, 75 + ktime_add(last_jiffies_update, tick_period)); 76 76 77 77 /* Slow path for long timeouts */ 78 78 if (unlikely(delta >= tick_period)) { ··· 81 79 82 80 ticks = ktime_divns(delta, incr); 83 81 84 - last_jiffies_update = ktime_add_ns(last_jiffies_update, 85 - incr * ticks); 82 + /* Pairs with the lockless read in this function. */ 83 + WRITE_ONCE(last_jiffies_update, 84 + ktime_add_ns(last_jiffies_update, 85 + incr * ticks)); 86 86 } 87 87 do_timer(++ticks); 88 88
+1
lib/vdso/gettimeofday.c
··· 221 221 return 0; 222 222 } 223 223 224 + static __maybe_unused 224 225 int __cvdso_clock_getres(clockid_t clock, struct __kernel_timespec *res) 225 226 { 226 227 int ret = __cvdso_clock_getres_common(clock, res);