<div dir="ltr">With older qemu-1.5.3, I can start the guest by removing the following lines from the xml config file and hugepages are correctly used.<div><p style="margin:0px;font-size:11px;font-family:Menlo">    <numa></p>
<p style="margin:0px;font-size:11px;font-family:Menlo">      <cell id='0' cpus='0-15' memory='67108864'/></p>
<p style="margin:0px;font-size:11px;font-family:Menlo">      <cell id='1' cpus='16-31' memory='67108864'/></p>
<p style="margin:0px;font-size:11px;font-family:Menlo">    </numa></p><p style="margin:0px;font-size:11px;font-family:Menlo"><br></p><p style="margin:0px;font-size:11px;font-family:Menlo">I believe these lines were used to create NUMA nodes for the guest. Removing them means no NUMA nodes for the guest I guess.</p><p style="margin:0px;font-size:11px;font-family:Menlo"><br></p><p style="margin:0px;font-size:11px;font-family:Menlo">There is one thing I don't quite understand though. In the xml file, I kept   </p><p style="margin:0px;font-size:11px;font-family:Menlo">  <numatune></p>
<p style="margin:0px;font-size:11px;font-family:Menlo">    <memory mode='strict' nodeset='0-1'/></p>
<p style="margin:0px;font-size:11px;font-family:Menlo">  </numatune></p><p style="margin:0px;font-size:11px;font-family:Menlo">Since no NUMA nodes were created, how come this section can pass? Then what is the nodeset here?</p><p style="margin:0px;font-size:11px;font-family:Menlo"><br></p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 11, 2015 at 10:27 AM, Clarylin L <span dir="ltr"><<a href="mailto:clearasu@gmail.com" target="_blank">clearasu@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Michal,</div><div><br></div>I also tried the other option you mentioned "The other option you have is to not use guest NUMA nodes, in which case global -mem-path can be used." by removing from xml <div><span class=""><p style="margin:0px;font-size:11px;font-family:Menlo">  <numatune></p>
<p style="margin:0px;font-size:11px;font-family:Menlo">    <memory mode='strict' nodeset='0-1'/></p>
<p style="margin:0px;font-size:11px;font-family:Menlo">  </numatune></p><div class="gmail_extra"><br></div></span><div class="gmail_extra">while keeping older qemu-1.5.3 which does not support <page> element, it still complained no enough memory when starting guest.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Did I miss something?</div><div><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 11, 2015 at 12:00 AM, Michal Privoznik <span dir="ltr"><<a href="mailto:mprivozn@redhat.com" target="_blank">mprivozn@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">[please keep the list CC'ed]<br>
<span><br>
On 10.06.2015 20:09, Clarylin L wrote:<br>
> Hi Michal,<br>
><br>
> Thanks a lot.<br>
><br>
> If 100 hugepages are pre-allocated, the guest can start without decreasing<br>
> number of hugepages. Since the guest requires 128 hugepages, it's kind of<br>
> expected that the guest would not take memory from hugepages.<br>
><br>
> Before guest start,<br>
><br>
> [root@local ~]# cat /proc/meminfo | grep uge<br>
><br>
</span>> AnonH*uge*Pages:         0 kB<br>
><br>
> H*uge*Pages_Total:     100<br>
><br>
> H*uge*Pages_Free:      100<br>
><br>
> H*uge*Pages_Rsvd:        0<br>
><br>
> H*uge*Pages_Surp:        0<br>
> H*uge*pagesize:    1048576 kB<br>
<span>><br>
> After:<br>
><br>
> [root@local ~]# cat /proc/meminfo | grep uge<br>
><br>
</span>> AnonH*uge*Pages:  134254592 kB<br>
><br>
> H*uge*Pages_Total:     100<br>
><br>
> H*uge*Pages_Free:      100<br>
><br>
> H*uge*Pages_Rsvd:        0<br>
><br>
> H*uge*Pages_Surp:        0<br>
> H*uge*pagesize:    1048576 kB<br>
<span>><br>
> There is no -mem-prealloc and -mem-path options in qemu command<br>
<br>
</span>And there can't be. From the command line below, you are defining 2 NUMA<br>
nodes for your guest. In order to instruct qemu to back their memory by<br>
huge pages you need it to support memory-backend-file object which was<br>
introduced in qemu-2.1.0.<br>
The other option you have is to not use guest NUMA nodes, in which case<br>
global -mem-path can be used.<br>
<span><br>
><br>
> [root@local ~]# ps -ef | grep qemu<br>
><br>
</span>> *qemu*      3403     1 99 17:42 ?        00:36:42 /usr/libexec/*qemu*-kvm<br>
<span>> -name qvpc-di-03-sf -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -cpu<br>
> host -m 131072 -realtime mlock=off -smp 32,sockets=2,cores=16,threads=1<br>
> -numa node,nodeid=0,cpus=0-15,mem=65536 -numa<br>
> node,nodeid=1,cpus=16-31,mem=65536 -uuid<br>
> e1b72349-4a0b-4b91-aedc-fd34e92251e4 -smbios type=1,serial=SCALE-SLOT-03<br>
> -no-user-config -nodefaults -chardev<br>
</span>> socket,id=charmonitor,path=/var/lib/libvirt/*qemu*/qvpc-di-03-sf.monitor,server,nowait<br>
<div><div>> -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown<br>
> -boot strict=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive<br>
> file=/var/lib/libvirt/images/asr5700/qvpc-di-03-sf-hda.img,if=none,id=drive-ide0-0-0,format=qcow2<br>
> -device<br>
> ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=2 -drive<br>
> if=none,id=drive-ide0-1-0,readonly=on,format=raw -device<br>
> ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1<br>
> -chardev pty,id=charserial0 -device<br>
> isa-serial,chardev=charserial0,id=serial0 -chardev pty,id=charserial1<br>
> -device isa-serial,chardev=charserial1,id=serial1 -vnc <a href="http://127.0.0.1:0" target="_blank">127.0.0.1:0</a> -vga<br>
> cirrus -device i6300esb,id=watchdog0,bus=pci.0,addr=0x3 -watchdog-action<br>
> reset -device vfio-pci,host=08:00.0,id=hostdev0,bus=pci.0,addr=0x5 -device<br>
> vfio-pci,host=09:00.0,id=hostdev1,bus=pci.0,addr=0x6 -device<br>
> vfio-pci,host=0a:00.0,id=hostdev2,bus=pci.0,addr=0x7 -device<br>
> virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 -msg timestamp=on<br>
><br>
><br>
> If 140 hugepages are preallocated, the guest cannot start and it complained<br>
> not enough memory.<br>
><br>
><br>
> The libvirt version is shown as follows:<br>
><br>
> virsh # version<br>
><br>
> Compiled against library: libvirt 1.2.8<br>
><br>
> Using library: libvirt 1.2.8<br>
><br>
> Using API: QEMU 1.2.8<br>
><br>
> Running hypervisor: QEMU 1.5.3<br>
><br>
><br>
<br>
<br>
<br>
> Also in guest configuration contains numa session. The hugepages are<br>
> uniformly distributed to two nodes. In this case, do I need to make<br>
> additional configurations to enable usage of hugepages?<br>
><br>
>   <numatune><br>
><br>
>     <memory mode='strict' nodeset='0-1'/><br>
><br>
>   </numatune><br>
><br>
<br>
</div></div>This says that all the memory for you guests should be pinned onto host<br>
nodes 0-1. If you want to be more specific, you can explicitly wire<br>
guest NUMA nodes onto host NUMA nodes in 1:N relationship (where N can<br>
be even 1, in which case you will get 1:1), e.g.:<br>
<br>
<memnode cellid='0' mode='preferred' nodeset='0'/><br>
<span><font color="#888888"><br>
Michal<br>
</font></span></blockquote></div><br></div></div></div></div></div>
</blockquote></div><br></div>