Hardy - Use MFENCE/LFENCE instead of CPUID

Bug #249135 reported by Tim Gardner on 2008-07-16
10
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Undecided
Unassigned
Hardy
Medium
Tim Gardner

Bug Description

Hi,

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 ubuntu-hardy tree.

The fix is to use MFENCE/LFENCE instead of CPUID. This series of patches backports those commits for current ubuntu's git tree.

Please have a look.

Thanks,
Alok

Steve Langasek (vorlon) on 2008-07-17
Changed in linux:
assignee: nobody → timg-tpi
importance: Undecided → Medium
milestone: none → ubuntu-8.04.2
status: New → In Progress
milestone: ubuntu-8.04.2 → ubuntu-8.10-beta
Steve Langasek (vorlon) wrote :

Accepted into -proposed, please test and give feedback here. Please see https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in linux:
milestone: ubuntu-8.04.2 → none
status: In Progress → Fix Committed
Steve Langasek (vorlon) wrote :

Marking this as verification-failed because of bug #251344, a regression between 2.6.24-19 and 2.6.24-20. I don't know if that's tied to this change, but seems as good as any for tracking...

Jouni Mettala (jouni-mettala) wrote :

Since some intel cpu:s are affected too should arch/x86/kernel/cpu/intel.c be patched too?

Something like:
- if (cpu_has_xmm)
+ if (cpu_has_xmm2)
      set_bit(X86_FEATURE_LFENCE_RDTSC, c->x86_capability);

to /arch/x86/kernel/cpu/intel.c

Martin Pitt (pitti) wrote :

Accepted into -proposed, please test and give feedback here. Please see https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Martin Pitt (pitti) wrote :

Regression verified as fixed in bug 251334.

Martin Pitt (pitti) wrote :

linux 2.6.24-21 copied to hardy-updates.

Changed in linux:
status: Fix Committed → Fix Released
Steve Langasek (vorlon) wrote :

This bug is still only marked as 'fix committed' for intrepid and beyond, since last July. Can someone confirm that it's fixed in intrepid/jaunty?

Tim Gardner (timg-tpi) on 2009-04-14
Changed in linux (Ubuntu):
assignee: Tim Gardner (timg-tpi) → nobody
importance: Medium → Undecided
milestone: ubuntu-8.10-beta → none
status: Fix Committed → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers