Hardy - Use MFENCE/LFENCE instead of CPUID

Bug #249135 reported by Tim Gardner
10
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Invalid
Undecided
Unassigned
Hardy
Fix Released
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

Revision history for this message
Tim Gardner (timg-tpi) wrote :
Changed in linux:
assignee: nobody → timg-tpi
importance: Undecided → Medium
milestone: none → ubuntu-8.04.2
status: New → Fix Committed
Steve Langasek (vorlon)
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
Revision history for this message
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
Revision history for this message
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...

Revision history for this message
Tim Gardner (timg-tpi) wrote :
Revision history for this message
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

Revision history for this message
Tim Gardner (timg-tpi) wrote :
Revision history for this message
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!

Revision history for this message
Martin Pitt (pitti) wrote :

Regression verified as fixed in bug 251334.

Revision history for this message
Martin Pitt (pitti) wrote :

linux 2.6.24-21 copied to hardy-updates.

Changed in linux:
status: Fix Committed → Fix Released
Revision history for this message
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)
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.