[Once again, I ask you to keep the list on the CC. In gmail's web UI
it's the 'Reply to all' button].
On 10/22/22 11:19, Simon Fairweather wrote:> Is there a way to limit the shared memory allocated via Libvirt to
> memory backing?
>
Yes, there is.
On the top level there's /domain/memoryBacking [1] that serves as the
default value for the guest. Then, under /domain/cpu/numa/cell [2]
individual guest NUMA nodes are configured and each can have @memAccess
attribute which overrides the top level setting (=memoryBacking). And
finally, under /domain/devices/memory [3] individual RAM modules can be
configured, and each one can have @access attribute which overrides both
top level AND guest NUMA node setting.
For instance:
<domain>
<maxMemory slots='16' unit='GiB'>8</maxMemory>
<memory unit='GiB'>5</memory>
<memoryBacking>
<access mode='private'/>
</memoryBacking>
...
<cpu>
<numa>
<cell id='0' memory='2' unit='GiB'
memAccess='shared'/>
<cell id='1' memory='2' unit='GiB' />
</numa>
</cpu>
...
<devices>
<memory model='dimm' access='private'>
<target>
<size unit='GiB'>1</size>
<node>0</node>
</target>
</memory>
</device>
</domain>
Here, the guest NUMA node 0 is going to be shared, except for DIMM
module attached to it (which is going to be private) and NUMA node 1 is
going to be private again.
Michal
1: https://libvirt.org/formatdomain.html#memory-backing
2: https://libvirt.org/formatdomain.html#cpu-model-and-topology
3: https://libvirt.org/formatdomain.html#memory-devices
> >
> On Mon, Oct 17, 2022 at 9:06 AM Michal Pr?vozn?k <mprivozn at redhat.com
> <mailto:mprivozn at redhat.com>> wrote:
>
> [please keep the list on CC for benefit of the community]
> On 10/16/22 09:58, Simon Fairweather wrote:
> > Thanks Michal, Are there any known issues with Memory?Backing.?We
have
> > QEMU 7.1 and libvirt 8.7.
> >
> > If just Memory Backing is set the VM Freezes after a couple of
> hours and
> > the allocated CPUs show 100% on the host.
> >
> > Seems to happen more on AMD Platforms than Intel.
> >
> > Please advise on any info you need, likely this is a QEMU issue.
> >
> >? ?<memoryBacking>
> >? ? ?<source type='memfd'/>
> >? ? ?<access mode='shared'/>
> >? ?</memoryBacking>
>
> Agreed, this smells like QEMU issue. There's nothing obviously
wrong
> with this snipped. I have a VM with just that and run it just fine.
> Although, I run it for couple of hours max.
>
> Michal
>