Bug 1371770

Summary: Host NUMA memory placement ignored unless guest has NUMA nodes
Product: [Community] Virtualization Tools Reporter: sam.bobroff
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: NEW --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: libvirt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Guest XML none

Description sam.bobroff 2016-08-31 05:09:40 UTC
Created attachment 1196164 [details]
Guest XML

Description of problem:

If a guest is created:

* on a host with more than one NUMA node

* and the guest is backed with host hugepages using either:
<memoryBacking><hugepages/></memoryBacking>
or
<memoryBacking><hugepages><page size='XX' unit='KiB' nodeset='YY'/></hugepages></memoryBacking>
(Where XX, YY and ZZ are set appropriately for your host.)

* and NUMA placement is specified for the hugepages using:
<numatune><memory mode='strict' nodeset='ZZ'/></numatune>

Then hugepages are allocated without respecting the placement given in the numatune block. The guest will start even if the NUMA policy is invalid (e.g. when nodeset contains nodes that don't exist).

The problem is not seen if <cpu><numa><cell ...> and <numatune><memnode ...> are used to create guest NUMA nodes bound to host NUMA nodes.

It is also not seen if the host does not have the cpuset cgroup mounted. (e.g. after "unmount /sys/fs/cgroup/cpuset".) This seems to be due to a fall-back path in libvirt being invoked that works differently.


Version-Release number of selected component (if applicable): 2.2.0


How reproducible: Every time.


Steps to Reproduce:
1. Create simple guest using virt-install.
2. Edit guest with virsh edit to add NUMA and hugepage XML.
3. Start guest.

Actual results:
Guest starts with hugepages allocated from incorrect NUMA host nodes.

Expected results:
Guest starts with hugepages allocated from host NUMA nodes according to policy given in guest XML or refuses to start if policy can't be followed.

Additional info:
Any fix should be careful not to affect migration.