[libvirt] [PATCH] add flag to enforce hugepage backing of guest RAM

Daniel P. Berrange berrange at redhat.com
Wed Feb 5 09:49:53 UTC 2014


On Tue, Feb 04, 2014 at 03:04:11PM -0700, Eric Blake wrote:
> On 02/04/2014 02:57 PM, Marcelo Tosatti wrote:
> > 
> >> So perhaps we do need some "policy" attribute on the <hugepages/>
> >> element to indicate desired behaviour here.
> > 
> > What about the following new element under <hugepages/> ?
> > 
> > enforce_hugepage_size=integer 
> 
> Which feels a bit redundant (we're already under the <hugepages>
> element, after all).  Maybe:
> 
> <hugepages>
>   <size strict='yes' unit='G'>1</size>
> </hugepages>
> 
> where strict could be no if we are giving a hint but don't care if the
> hint cannot be honored (default yes if omitted), and where unit + value
> allows the user to input the size in a sensible unit (on output, we'd
> probably want to use unit='k' and spell out 1048576, for similarity with
> all our other memory interfaces that output in k for back-compat reasons).

I don't think strict=yes|no is neccessarily the best. Per my previous
mail in this thread there are at least 3 possible policies that could
be implemented. 

 - Require memory size multiple of hugepage size
 - Round memory size upto multiple of huge page size
 - Fill in with smaller huge pages

So I'd say   policy="round|exact|bestfit"  even if QEMU doesn't decide
to actually implement all 3 possible policies, we at least futureproof
ourselves by not using a boolean.


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list