diff options
author | Peter Zijlstra <peterz@infradead.org> | 2024-08-07 14:29:28 +0300 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2024-08-08 13:27:32 +0300 |
commit | 5d95a2af973d47260b1e1828953fc860c0094052 (patch) | |
tree | be4ff007c3e56cd4dc80b30cfdeaa4f559efc2f9 /Documentation/devicetree/bindings/clock/amlogic,s4-pll-clkc.yaml | |
parent | 558abc7e3f895049faa46b08656be4c60dc6e9fd (diff) | |
download | linux-5d95a2af973d47260b1e1828953fc860c0094052.tar.xz |
perf: Add context time freeze
Many of the the context reschedule users are of the form:
ctx_sched_out(.type = EVENT_TIME);
... modify context
ctx_resched();
With the idea that the whole reschedule happens with a single
time-stamp, rather than with each ctx_sched_out() advancing time and
ctx_sched_in() re-starting time, creating a non-atomic experience.
However, Kan noticed that since this completely stops time, it
actually looses a bit of time between the stop and start. Worse, now
that we can do partial (per PMU) reschedules, the PMUs that are not
scheduled out still observe the time glitch.
Replace this with:
ctx_time_freeze();
... modify context
ctx_resched();
With the assumption that this happens in a perf_ctx_lock() /
perf_ctx_unlock() pair.
The new ctx_time_freeze() will update time and sets EVENT_FROZEN, and
ensures EVENT_TIME and EVENT_FROZEN remain set, this avoids
perf_event_time_now() from observing a time wobble from not seeing
EVENT_TIME for a little while.
Additionally, this avoids loosing time between
ctx_sched_out(EVENT_TIME) and ctx_sched_in(), which would re-set the
timestamp.
Reported-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240807115550.250637571@infradead.org
Diffstat (limited to 'Documentation/devicetree/bindings/clock/amlogic,s4-pll-clkc.yaml')
0 files changed, 0 insertions, 0 deletions