<div dir="ltr">I did some test for virtio-mem with libvirt upstream version v7.0.0-153-g5ea3ecd07d<br> & qemu-kvm-5.2.0-0.7.rc2.fc34.x86_64<br><br>S1. Start domain with memory device <br><br>1. Domain configuration-<br><maxMemory slots='16' unit='KiB'>10485760</maxMemory><br>  <memory unit='KiB'>1572864</memory><br>  <currentMemory unit='KiB'>1572864</currentMemory><br> ...<br>  <cpu mode='host-model' check='partial'><br>    <numa><br>      <cell id='0' cpus='0-3' memory='1048576' unit='KiB'/><br>    </numa><br>  </cpu><br>...<br>  <memory model='virtio-mem'><br>      <target><br>        <size unit='KiB'>524288</size><br>        <node>0</node><br>        <block unit='KiB'>2048</block><br>        <requested unit='KiB'>393216</requested><br>      </target><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/><br>    </memory><br>#virsh start pc<div> Domain 'pc'  started<br><br>2. The domain is started and check mem status, the actual size is "1048576"<br>#virsh dommemstat pc<br>actual 1048576<br>swap_in 0<br>swap_out 0<br>major_fault 257<br>minor_fault 130540<br>unused 604064<br>available 761328<br>usable 578428<br>last_update 1612325471<br>disk_caches 49632<br>hugetlb_pgalloc 0<br>hugetlb_pgfail 0<br>rss 460260<br><br>3. Then, check the active xml -<br># virsh dumpxml pc<br>... <br><memory unit='KiB'>1572864</memory><br>  <currentMemory unit='KiB'>1048576</currentMemory><br>....<br> <memory model='virtio-mem'><br>      <target><br>        <size unit='KiB'>524288</size><br>        <node>0</node><br>        <block unit='KiB'>2048</block><br>        <requested unit='KiB'>393216</requested><br>        <actual unit='KiB'>0</actual><br>      </target><br>      <alias name='virtiomem0'/><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/><br>    </memory><br><br> Question1 : the value of actual is "0". Is it expected?<br><br>S2. Also, tried to use hugepage to start the domain -<br><br><memory model='virtio-mem'><br>      <target><br>        <size unit='KiB'>524288</size><br>        <node>0</node><br>        <block unit='KiB'>2048</block><br>        <requested unit='KiB'>393216</requested><br>        <actual unit='KiB'>0</actual><br>      </target><br>      <alias name='virtiomem0'/><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/><br>    </memory><br><br>#virsh start pc<br>error: Failed to start domain 'pc'<br>error: internal error: process exited while connecting to monitor: 2021-02-03T05:50:33.157836Z qemu-system-x86_64: -object memory-backend-file,id=memvirtiomem0,mem-path=/dev/hugepages/libvirt/qemu/9-pc,size=536870912,host-nodes=0,policy=bind: can't open backing store /dev/hugepages/libvirt/qemu/9-pc for guest RAM: Permission denied<br></div><div> </div><div>Question 2: any bug here?</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 2, 2021 at 9:44 PM Peter Krempa <<a href="mailto:pkrempa@redhat.com">pkrempa@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, Jan 22, 2021 at 13:50:21 +0100, Michal Privoznik wrote:<br>
> Technically, this is another version of:<br>
> <br>
> <a href="https://www.redhat.com/archives/libvir-list/2020-December/msg00199.html" rel="noreferrer" target="_blank">https://www.redhat.com/archives/libvir-list/2020-December/msg00199.html</a><br>
> <br>
> But since virtio-pmem part is pushed now, I've reworked virtio-mem a bit<br>
> and sending it as a new series.<br>
> <br>
> For curious ones, David summarized behaviour well when implementing<br>
> virtio-mem support in kernel:<br>
> <br>
> <a href="https://lwn.net/Articles/755423/" rel="noreferrer" target="_blank">https://lwn.net/Articles/755423/</a><br>
> <br>
> For less curious ones:<br>
> <br>
>   # virsh update-memory $dom --requested-size 4G<br>
> <br>
> adds additional 4GiB of RAM to guest;<br>
> <br>
>   # virsh update-memory $dom --requested-size 0<br>
> <br>
> removes those 4GiB added earlier.<br>
> <br>
> Patches are also available on my GitLab:<br>
> <br>
> <a href="https://gitlab.com/MichalPrivoznik/libvirt/-/tree/virtio_mem_v3" rel="noreferrer" target="_blank">https://gitlab.com/MichalPrivoznik/libvirt/-/tree/virtio_mem_v3</a><br>
> <br>
<br>
Patches 1-7,9-10 (but observe some individual comments, including<br>
the rename of the virsh commands):<br>
<br>
Reviewed-by: Peter Krempa <<a href="mailto:pkrempa@redhat.com" target="_blank">pkrempa@redhat.com</a>><br>
<br>
Patch 8 has severe semantic problems.<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Thanks & Regards,<br>Jing,Qi<br></div></div>