Skip to content

Make the TSC safe to be used by gettimeofday().

Suleiman Souhlal lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 15 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Make the TSC safe to be used by gettimeofday().arch/x86_64/kernel/process.c arch/x86_64/kernel/time.c arch/x86_64/kernel/vmlinux.lds.S +4 more+3 -37 replies
2/2Introduce a vmonotonic_clock() vsyscall.arch/x86_64/kernel/vsyscall.c include/asm-x86_64/vsyscall.h+0 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/2] Make the TSC safe to be used by gettimeofday().

I've had a proof-of-concept for this since August, and finally got around to somewhat cleaning it up.

It can certainly still be improved, namely by using vgetcpu() instead of CPUID to find the cpu number (but I couldn't get it to work, when I tried). Another possible improvement would be to use RDTSCP when available. There's also a small race in do_gettimeofday(), vgettimeofday() and vmonotonic_clock() but I've never seen it happen.

Suggestions are welcome.

-- Suleiman