diff options
author | Peter Zijlstra <peterz@infradead.org> | 2023-01-26 18:08:37 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2023-01-31 17:01:47 +0300 |
commit | 776f22913b8e50011004c6ae43004711dab7efa5 (patch) | |
tree | 4ec81b56293836a378fb57ad7fe2156a6b0e3c92 /include/linux/sched | |
parent | 8739c6811572b087decd561f96382087402cc343 (diff) | |
download | linux-776f22913b8e50011004c6ae43004711dab7efa5.tar.xz |
sched/clock: Make local_clock() noinstr
With sched_clock() noinstr, provide a noinstr implementation of
local_clock().
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20230126151323.760767043@infradead.org
Diffstat (limited to 'include/linux/sched')
-rw-r--r-- | include/linux/sched/clock.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/include/linux/sched/clock.h b/include/linux/sched/clock.h index 867d588314e0..ca008f7d3615 100644 --- a/include/linux/sched/clock.h +++ b/include/linux/sched/clock.h @@ -45,7 +45,7 @@ static inline u64 cpu_clock(int cpu) return sched_clock(); } -static inline u64 local_clock(void) +static __always_inline u64 local_clock(void) { return sched_clock(); } @@ -79,10 +79,8 @@ static inline u64 cpu_clock(int cpu) return sched_clock_cpu(cpu); } -static inline u64 local_clock(void) -{ - return sched_clock_cpu(raw_smp_processor_id()); -} +extern u64 local_clock(void); + #endif #ifdef CONFIG_IRQ_TIME_ACCOUNTING |