[libvirt] Problem with setting up KVM guests to use HugePages

Michal Privoznik mprivozn at redhat.com
Thu Jun 11 08:27:05 UTC 2015


On 11.06.2015 10:13, Daniel P. Berrange wrote:
> On Wed, Jun 10, 2015 at 09:20:40PM +0000, Vivi L wrote:
>> Michal Privoznik <mprivozn <at> redhat.com> writes:
>>
>>>
>>> On 10.06.2015 01:05, Vivi L wrote:
>>>> Kashyap Chamarthy <kchamart <at> redhat.com> writes:
>>>>
>>>>
>>>>> You might want re-test by explicitly setting the 'page' element and
>>>>> 'size' attribute? From my test, I had something like this:
>>>>>
>>>>>     $ virsh dumpxml f21-vm | grep hugepages -B3 -A2 
>>>>>       <memory unit='KiB'>2000896</memory>
>>>>>       <currentMemory unit='KiB'>2000000</currentMemory>
>>>>>       <memoryBacking>
>>>>>         <hugepages>
>>>>>           <page size='2048' unit='KiB' nodeset='0'/>
>>>>>         </hugepages>
>>>>>       </memoryBacking>
>>>>>       <vcpu placement='static'>8</vcpu>
>>>>>
>>>>> I haven't tested this exhaustively, but some basic test notes here:
>>>>>
>>>>>     https://kashyapc.fedorapeople.org/virt/test-hugepages-with-libvirt.txt
>>>>
>>>> Current QEMU does not support setting <page> element. Could it be the 
>>>> cause of my aforementioned problem?
>>>>
>>>> unsupported configuration: huge pages per NUMA node are not supported 
>>>> with this QEMU
>>>>
>>>
>>> So this is explanation why the memory for you guest is not backed by
>>> hugepages.
>>
>> I thought setting hugepages per NUMA node is a nice-to-have feature. 
>> Is it required to enable the use of hugepages for the guest?
> 
> No, it should not be mandatory. You should be able to use
> 
>   <memoryBacking>
>         <hugepages/>
>   </memoryBacking>
> 
> With pretty much any KVM/QEMU version that exists. If that's
> broken then its a libvit bug.

Unless hugepages are requested for guest NUMA nodes. In that case
memory-backend-file object is required. From my investigation, this
seems to be the case.

Michal




More information about the libvir-list mailing list