Skip to content

Commit 2367e28

Browse files
anna-marialxKAGA-KOKO
authored andcommitted
timers/migration: Spare write when nothing changed
The wakeup value is written unconditionally in tmigr_cpu_new_timer(). When there was no new next timer expiry that needs to be propagated, then the value that was read before is written. This is not required. Move the write to the place where wakeup value is changed changed. Signed-off-by: Anna-Maria Behnsen <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Frederic Weisbecker <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 835a9a6 commit 2367e28

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

kernel/time/timer_migration.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,14 +1215,13 @@ u64 tmigr_cpu_new_timer(u64 nextexp)
12151215
if (nextexp != tmc->cpuevt.nextevt.expires ||
12161216
tmc->cpuevt.ignore) {
12171217
ret = tmigr_new_timer(tmc, nextexp);
1218+
/*
1219+
* Make sure the reevaluation of timers in idle path
1220+
* will not miss an event.
1221+
*/
1222+
WRITE_ONCE(tmc->wakeup, ret);
12181223
}
12191224
}
1220-
/*
1221-
* Make sure the reevaluation of timers in idle path will not miss an
1222-
* event.
1223-
*/
1224-
WRITE_ONCE(tmc->wakeup, ret);
1225-
12261225
trace_tmigr_cpu_new_timer_idle(tmc, nextexp);
12271226
raw_spin_unlock(&tmc->lock);
12281227
return ret;

0 commit comments

Comments
 (0)