diff options
| author | Usama Arif <usama.arif@linux.dev> | 2026-09-18 06:34:08 -0700 |
|---|---|---|
| committer | Thomas Gleixner <tglx@kernel.org> | 2026-09-29 21:00:08 +0200 |
| commit | d305927765cf6025bc11db9d96c06ea663230ddd (patch) | |
| tree | 06a0388427556fe49a199b0b1523507d1657c01b /scripts/Makefile.thinlto | |
| parent | 75990fb534e858ac61ae7651c4695e0905a04443 (diff) | |
| download | linux-d305927765cf6025bc11db9d96c06ea663230ddd.tar.gz linux-d305927765cf6025bc11db9d96c06ea663230ddd.zip | |
tick/nohz: Avoid unused timekeeping_max_deferment() calls
tick_nohz_next_event() limits a CPU's sleep interval to the maximum
deferment supported by the current clocksource when that CPU owns the
do_timer() duty. If the duty is unassigned, the limit also applies when
the CPU's TS_FLAG_DO_TIMER_LAST flag is set.
After the early timer checks, the function currently reads the maximum
deferment unconditionally. It then replaces the result with KTIME_MAX
unless one of the two conditions above applies.
timekeeping_max_deferment() performs a seqcount-protected read of the
shared timekeeper and follows its clocksource pointer. Check the do_timer
state first and avoid this work when the result would be discarded. This
leaves the resulting expiry unchanged and reduces accesses to timekeeper
data that is modified regularly.
On x86-64 this removes 18-20 dynamically executed instructions, including
the call, from the common non-owner path when the seqcount does not retry.
Signed-off-by: Usama Arif <usama.arif@linux.dev>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: Rik van Riel <riel@surriel.com>
Link: https://patch.msgid.link/20260918133408.2834751-1-usama.arif@linux.dev
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
