Comment 4 for bug 248509

Revision history for this message
In , Alok (alok-redhat-bugs) wrote :

Description of problem:

There have been a series of patches committed to the mainline kernel
recently that address a performance issue for gettimeofday when running
on hypervisors that enable hardware assisted virtualization. The
non-ideal performance occurs because a CPUID instruction is used to
serialize the pipeline before RDTSC, and when using hardware
virtualization, CPUID always exits to the hypervisor.

The code in question also exists in the RHEL 5.2 64-bit kernel (see
get_cycles_sync in include/asm-x86_64/timex.h).

The fix is to use MFENCE/LFENCE instead of CPUID. Here are links to
relevant patches by Andi Kleen which are now in git:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=de4218634e3df6d73a3e6cdfdf3a17fa3bc7e013
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=707fa8ed923b1b6a3d7af0d386b0b3abad28ed19
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fde1b3fa947c2512e3715962ebb1d3a6a9b9bb7d
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6d63de8dbcda98511206897562ecfcdacf18f523
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f06e4ec1c15691b0cfd2397ae32214fa36c90d71

Would you be able to make a similar change to the RHEL 5.2 kernel, to
address this issue ?

Thanks,
Alok