Skip to content

Try 2: Make the TSC safe to be use by gettimeofday().

Suleiman Souhlal lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1Make the TSC safe to be used by gettimeofday().arch/x86_64/kernel/process.c arch/x86_64/kernel/setup64.c arch/x86_64/kernel/time.c +7 more+3 -32 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/1] Try 2: Make the TSC safe to be use by gettimeofday().

Hi,

Here are the fixes from the previous version:
- Don't use hard_smp_processor_id().
- Use the PDA to store a pointer to the current CPU's vxtime data.
- Use vgetcpu() to get the CPU number from vgettimeofday()
(Due to a bug in vgetcpu(), this only works with CONFIG_HOTPLUG_CPU=y)
- No externs in .c files
- Use idle notifiers instead of doing the HPET read in switch_to
- Fix race in vgettimeofday() by checking the RIP of the process we're switching away from in switch_to, and touching the vxtime seqlock if it happens to be in the VSYSCALL page. (I hope this is not considered too much work for switch_to)
- Remove usage of preempt_disable/enable() in do_gettimeoday(), since the above fix make it unnecessary.

-- Suleiman