summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorUsama Arif <usama.arif@linux.dev>2026-07-07 08:38:00 -0700
committerThomas Gleixner <tglx@kernel.org>2026-07-07 23:26:58 +0200
commitc4415c993fc2c8bdf2cf0bfbcbb1ac0e0f7a9eaf (patch)
tree20b98756e04c290cde9976f1bd4da84b467953f5 /tools/perf/scripts/python/stackcollapse.py
parent1d28a67d496f482933b0ba5d8577835bdbe601ca (diff)
hrtimer: Don't take cpu_base::lock in hrtimer_get_next_event() when hres_active
hrtimer_get_next_event() runs on every tick-stop decision via get_next_timer_interrupt() -> cmp_next_hrtimer_event(). When high resolution timers are active it must return KTIME_MAX -- the caller documents and depends on this. The function takes cpu_base->lock, checks hres_active, and returns KTIME_MAX. Taking the lock is not required because cpu_base->hres_active is only written by the local CPU in hrtimer_switch_to_hres() from hard interrupt context and in hrtimers_cpu_starting() during bring-up. All callers of hrtimer_get_next_event() reach it from the tick-stop / cpuidle paths with interrupts disabled on that CPU. No writer can therefore race with the read, so an unlocked hres_active check is stable and the lock can be skipped in this case. On a 176-thread AMD EPYC 9D64 running a production workload, bucketing callers of native_queued_spin_lock_slowpath(), the slowpath had 199 samples in total, of which 54 are attributed to hrtimer_get_next_event(), i.e. this accounts for ~27% of slowpath hits on this specific workload. Move the hres_active check before the lock guard region to address this. [ tglx: Massaged change log and comments ] Signed-off-by: Usama Arif <usama.arif@linux.dev> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Link: https://patch.msgid.link/20260707153800.542394-1-usama.arif@linux.dev
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions