Skip to content

RFC sched: Optimize sched_clock bits

Peter Zijlstra lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest7 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7math64: mul_u64_u32_shr()arch/x86/Kconfig include/linux/math64.h init/Kconfig+37 -00 replies
2/7x86: Use mul_u64_u32_shr() for native_sched_clock()arch/x86/include/asm/timer.h+3 -40 replies
3/7x86: Avoid a runtime condition in native_sched_clock()arch/x86/kernel/tsc.c+6 -10 replies
4/7x86: Move some code aroundarch/x86/include/asm/timer.h arch/x86/kernel/tsc.c+61 -1100 replies
5/7x86: Use latch data structure for cyc2nsarch/x86/include/asm/timer.h arch/x86/kernel/cpu/perf_event.c arch/x86/kernel/tsc.c+195 -312 replies
6/7sched: Remove local_irq_disable() from the clockskernel/sched/clock.c+4 -260 replies
7/7sched: Use a static_key for sched_clock_stablearch/x86/kernel/cpu/amd.c arch/x86/kernel/cpu/intel.c arch/x86/kernel/cpu/perf_event.c +6 more+46 -170 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC][PATCH 0/7] sched: Optimize sched_clock bits

Hi all,

This series is supposed to optimize the kernel/sched/clock.c and x86 sched_clock() implementations.

So far its only been boot tested. So no clue if it really makes the thing faster, but it does remove the need to disable IRQs.

I'm hoping Eliezer will test this with his benchmark where he could measure a performance regression between using sched_clock() and local_clock().

It looks like ia64, the only other CONFIG_HAVE_UNSTABLE_SCHED_CLOCK user, already matches the new expectations -- mostly not requiring IRQs disabled for calling sched_clock().