Libvirt KVM: Huge pages need to be mapped shared to allow vhostuser access

Bug #1561593 reported by Roman Podoliaka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
In Progress
High
MOS Maintenance

Bug Description

Upstream bug: https://bugs.launchpad.net/nova/+bug/1447079

By default, when a KVM guest is setup using huge pages, the pages are mapped using the MAP_PRIVATE flag to mmap().

The vhostuser VIF backend is designed to allow an external process to provide the QEMU network driver functionality. For some usecases of vhostuser, this requires that the external process be able to access the QEMU guest's memory pages directly. This is not possible when the hugepages are mapped with MAP_PRIVATE - they must use MAP_SHARED instead.

The result is that current Nova hugepages config doesn't work too well with vhostuser VIF backend.

The fix to this is to tell libvirt to use a shared mapping for huge pages

http://libvirt.org/formatdomain.html#elementsCPU

eg:

  ...
  <cpu>
    ...
    <numa>
      <cell id='0' cpus='0-3' memory='512000' unit='KiB' memAccess='shared'/>
      <cell id='1' cpus='4-7' memory='512000' unit='KiB' memAccess='shared'/>
    </numa>
    ...
  </cpu>
  ...

notice the addition of the memAccess attribute.

There is no serious downside to using shared mappings, so Nova might as well just unconditionally request them all the time.

Changed in mos:
assignee: nobody → Roman Podoliaka (rpodolyaka)
tags: added: area-nova contrail
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix proposed to openstack/nova (openstack-ci/fuel-7.0/2015.1.0)

Fix proposed to branch: openstack-ci/fuel-7.0/2015.1.0
Change author: Daniel P. Berrange <email address hidden>
Review: https://review.fuel-infra.org/18687

Changed in mos:
status: Confirmed → In Progress
Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :

Maintenance team, could you please consider including this into a MU?

Changed in mos:
assignee: Roman Podoliaka (rpodolyaka) → MOS Maintenance (mos-maintenance)
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Change abandoned on openstack/nova (openstack-ci/fuel-7.0/2015.1.0)

Change abandoned by Roman Podoliaka <email address hidden> on branch: openstack-ci/fuel-7.0/2015.1.0
Review: https://review.fuel-infra.org/18687

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.