diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2019-12-04 10:54:47 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2019-12-04 10:54:47 +1100 |
commit | 4fc52faf253242cb5bab57fcb062e37e89770ad8 (patch) | |
tree | 265255968de646fad754c1bc0b1edc4d966ed9fa /kernel/time/hrtimer.c | |
parent | 4b91b79c32a4d6623506e46f495cc1af809e5de9 (diff) | |
parent | e445033e58108a9891abfbc0dea90b066a75e4a9 (diff) | |
download | linux-next-4fc52faf253242cb5bab57fcb062e37e89770ad8.tar.gz |
Merge remote-tracking branch 'tip/auto-latest'
# Conflicts:
# arch/x86/entry/entry_32.S
# arch/x86/include/asm/pgtable_32_types.h
# arch/x86/kernel/head_32.S
# arch/x86/mm/pat_interval.c
# include/trace/events/rpcrdma.h
# kernel/time/time.c
# kernel/trace/trace_export.c
Diffstat (limited to 'kernel/time/hrtimer.c')
-rw-r--r-- | kernel/time/hrtimer.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 9e20873148c6..8de90ea31280 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -966,7 +966,8 @@ static int enqueue_hrtimer(struct hrtimer *timer, base->cpu_base->active_bases |= 1 << base->index; - timer->state = HRTIMER_STATE_ENQUEUED; + /* Pairs with the lockless read in hrtimer_is_queued() */ + WRITE_ONCE(timer->state, HRTIMER_STATE_ENQUEUED); return timerqueue_add(&base->active, &timer->node); } @@ -988,7 +989,8 @@ static void __remove_hrtimer(struct hrtimer *timer, struct hrtimer_cpu_base *cpu_base = base->cpu_base; u8 state = timer->state; - timer->state = newstate; + /* Pairs with the lockless read in hrtimer_is_queued() */ + WRITE_ONCE(timer->state, newstate); if (!(state & HRTIMER_STATE_ENQUEUED)) return; @@ -1013,8 +1015,9 @@ static void __remove_hrtimer(struct hrtimer *timer, static inline int remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base, bool restart) { - if (hrtimer_is_queued(timer)) { - u8 state = timer->state; + u8 state = timer->state; + + if (state & HRTIMER_STATE_ENQUEUED) { int reprogram; /* |