public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] arm64: perf_event: Fix time offset prior to epoch
@ 2020-05-05 13:55 Leo Yan
  2020-05-05 13:55 ` [PATCH v2 1/3] time/sched_clock: Add new variant sched_clock_register_epoch() Leo Yan
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Leo Yan @ 2020-05-05 13:55 UTC (permalink / raw)
  To: Peter Zijlstra, Will Deacon, Marc Zyngier, Mark Rutland,
	Ingo Molnar, Arnaldo Carvalho de Melo, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, Catalin Marinas, Daniel Lezcano,
	Thomas Gleixner, Allison Randal, Alexios Zavras,
	Greg Kroah-Hartman, Kate Stewart, Enrico Weigelt,
	Ahmed S. Darwish, Paul Cercueil, Ben Dooks (Codethink),
	linux-kernel, linux-arm-kernel
  Cc: Leo Yan

This patch set is to fix time offset prior to epoch for Arm arch timer.
This series is mainly following on suggestions on LKML [1].

To acheive the accurate time offset for a clock source prior to epoch,
patch 01 adds a new variant sched_clock_register_epoch() which allows to
output an extra argument for time offset prior to sched clock's
registration.

Patch 02 is to add handling for time offset in Arm arch timer driver, As
Will Deacon suggested to "disable the perf userpage if sched_clock
changes clocksource too" [2], after thinking about this suggestion, the
race condition doesn't exist between sched_clock's registration and perf
userpage.  The reason is sched_clock's registration is finished in
system's initialisation phase and at this point it has no chance to use
any userpage by Perf tool.  For this reason let's keep the code simple
and don't acquire all Perf events' seqlock during sched_clock's
registration.

Patch 03 is simply to pass time offset from arch timer driver
(clocksource driver) to perf event.

[1] https://lkml.org/lkml/2020/3/20/199
[2] https://lkml.org/lkml/2020/5/1/906

Changes from v1:
- Added patch 01 to retrieve more accurate offset when sched clock
  registration;
- Added patch 02 to handle time offset in arch timer driver.

Leo Yan (3):
  time/sched_clock: Add new variant sched_clock_register_epoch()
  clocksource/drivers/arm_arch_timer: Handle time offset prior to epoch
  arm64: perf_event: Fix time_offset for arch timer

 arch/arm64/kernel/perf_event.c       |  8 ++++++--
 drivers/clocksource/arm_arch_timer.c | 10 +++++++++-
 include/clocksource/arm_arch_timer.h |  6 ++++++
 include/linux/sched_clock.h          | 10 ++++++++++
 kernel/time/sched_clock.c            | 13 ++++++++++++-
 5 files changed, 43 insertions(+), 4 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-05-12 11:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-05 13:55 [PATCH v2 0/3] arm64: perf_event: Fix time offset prior to epoch Leo Yan
2020-05-05 13:55 ` [PATCH v2 1/3] time/sched_clock: Add new variant sched_clock_register_epoch() Leo Yan
2020-05-05 13:55 ` [PATCH v2 2/3] clocksource/drivers/arm_arch_timer: Handle time offset prior to epoch Leo Yan
2020-05-05 13:55 ` [PATCH v2 3/3] arm64: perf_event: Fix time_offset for arch timer Leo Yan
2020-05-11  9:22 ` [PATCH v2 0/3] arm64: perf_event: Fix time offset prior to epoch Peter Zijlstra
2020-05-11  9:25   ` Peter Zijlstra
2020-05-12  6:38     ` Leo Yan
2020-05-12  8:57       ` Peter Zijlstra
2020-05-12  9:19       ` Peter Zijlstra
2020-05-12 10:01         ` Mark Rutland
2020-05-12 11:21         ` Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox