[openstack-dev] [nova] [libvirt] enabling per node filtering of mempage sizes

Mooney, Sean K sean.k.mooney at intel.com
Tue Dec 2 19:44:23 UTC 2014

Hi all

I have submitted a small blueprint to allow filtering of available memory pages 
Reported by libvirt.


I believe that this change is small enough to not require a spec as per

if a core (and others are welcome too :)) has time to review my blueprint and confirm
that a spec is not required I would be grateful as the spd is rapidly approaching

I have wip code developed which I hope to make available for review once
I add unit tests.

All relevant detail (copied below) are included in the whiteboard for the blueprint.


Problem description

In the Kilo cycle, the virt drivers large pages feature[1] was introduced
to allow a guests to request the type of memory backing that they desire
via a flavor or image metadata.

In certain configurations, it may be desired or required to filter the
memory pages available to vms booted on a node. At present no mechanism
exists to allow filtering of reported memory pages.

Use Cases

On a host that only supports vhost-user or ivshmem,
all VMs are required to use large page memory.
If a vm is booted with standard pages with these interfaces,
network connectivity will not available.

In this case it is desirable to filter out small/4k pages when reporting
available memory to the scheduler.

Proposed change

This blueprint proposes adding a new config variable (allowed_memory_pagesize)
to the libvirt section of the nova.conf.

                help='List of allowed memory page sizes'
                     'Syntax is SizeA,SizeB e.g. small,large'
                     'valid sizes are: small,large,any,4,2048,1048576')

The _get_host_capabilities function in nova/nova/virt/libvirt/driver.py
will be modified to filter the mempages reported for each cell based on the
value of CONF.libvirt.allowed_memory_pagesize

If small is set then only 4k pages will be reported.
If large is set 2MB and 1GB will be reported.
If any is set no filtering will be applied.

The default value of "any" was chosen to ensure that this change has no effect on
existing deployment.

[1] - https://blueprints.launchpad.net/nova/+spec/virt-driver-large-pages

More information about the OpenStack-dev mailing list