<div dir="ltr"><div>Michal,</div><div>I checked the virtio_mem module and it's loaded -</div><div><br></div>lsmod |grep virtio_mem                       <br>virtio_mem             32768  0<br><div><br></div><div>And I can't make the actual value change to non-zerio.</div><div>->  virsh update-memory pc  --requested-size 256M</div><div><div>or <br></div><div>->virsh setmem pc 1000M</div></div><div><br></div><div> <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'>262144</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></div><div>Any other suggestions ?</div><div><br></div><div>> This is a bummer. What this represents is the actual value of membaloon.<div><div class="gmail-adm" style="margin:5px 0px"><div id="gmail-q_830" class="gmail-ajR gmail-h4" style="background-color:rgb(232,234,237);border:none;clear:both;line-height:6px;outline:none;width:24px;color:rgb(80,0,80);font-size:11px;border-radius:5.5px"><div class="gmail-ajT" style="background:url("https://www.gstatic.com/images/icons/material/system_gm/1x/more_horiz_black_20dp.png") 50% 50%/20px no-repeat;height:11px;opacity:0.71;width:24px"></div></div></div></div>> Yes and no. It shows that we need <actual/> because guest might ignore <br>> request to change the requested size. What you're probably experiencing <br>> is that you haven't loaded virtio_mem module and thus the virtio-mem <br>> device is ignoring requests for change (well, kernel is ignoring them, <br>> whatever).<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 4, 2021 at 12:27 AM Michal Privoznik <<a href="mailto:mprivozn@redhat.com">mprivozn@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 2/3/21 7:11 AM, Jing Qi wrote:<br>
> I did some test for virtio-mem with libvirt upstream version<br>
> 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'<br>
> function='0x0'/><br>
>      </memory><br>
> #virsh start pc<br>
>   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>
<br>
This is a bummer. What this represents is the actual value of membaloon.<br>
<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'<br>
> function='0x0'/><br>
>      </memory><br>
> <br>
>   Question1 : the value of actual is "0". Is it expected?<br>
<br>
Yes and no. It shows that we need <actual/> because guest might ignore <br>
request to change the requested size. What you're probably experiencing <br>
is that you haven't loaded virtio_mem module and thus the virtio-mem <br>
device is ignoring requests for change (well, kernel is ignoring them, <br>
whatever).<br>
<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'<br>
> 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:<br>
> 2021-02-03T05:50:33.157836Z qemu-system-x86_64: -object<br>
> memory-backend-file,id=memvirtiomem0,mem-path=/dev/hugepages/libvirt/qemu/9-pc,size=536870912,host-nodes=0,policy=bind:<br>
> can't open backing store /dev/hugepages/libvirt/qemu/9-pc for guest RAM:<br>
> Permission denied<br>
> <br>
> Question 2: any bug here?<br>
<br>
Ah, good catch! I'll fix this in v2.<br>
<br>
Michal<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>