qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about reduced memory by balloon driver (virtio-balloon)


From: Jakob Bohm
Subject: Re: Question about reduced memory by balloon driver (virtio-balloon)
Date: Wed, 16 Sep 2020 17:01:41 +0200
User-agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0

On 2020-09-16 13:35, Henry lol wrote:
Hi guys,

When a guest's memory is dynamically reduced with "balloon" QMP API, I'm wondering whether the virtio-balloon driver in the guest is consuming such reduced memory.

If so, how can I see that the memory virtio-balloon is consuming?
and is it possible the virtio-balloon has such a huge memory even though it's a kernel module??

Thanks,
I have not checked the source code for the qemu balloon driver, but the
traditional way such balloon drivers work is:

1. Qemu tells the balloon how much memory to remove from Guest

2. Balloon driver software may check the overall memory use on
the Guest and adjust the request accordingly.  This is useful to
grant the memory to whichever Guest needs it the most.

3. Balloon driver pretends that it is a very advanced hardware device (such
as a shared-memory GPU) that needs a range of physical RAM to be accessed
directly via the I/O bus for some hardware purpose, it asks for the amount
needed.

4. The Guest OS hands that "phyisical" memory range to the device (or
declares Guest memory full).

5. The Balloon driver hands the "physical" RAM addresses back to qemu,
which can then removes host memory backing from that virtual machine
address range.

6. The actual amount of physical memory can be seen as either the "non-paged
memory use" of the balloon driver, as a special number in the Guest memory
statistics (if the Guest kernel has integrated the concept directly), or by
querying qemu on the host via one of the two "monitor" interfaces (The Human
Monitoring Protocol or the machine monitoring protocol).


--
Jakob Bohm, CIO, partner, WiseMo A/S. https://www.wisemo.com
Transformervej 29, 2860 Soborg, Denmark. direct: +45 31 13 16 10 <tel:+4531131610>
This message is only for its intended recipient, delete if misaddressed.
WiseMo - Remote Service Management for PCs, Phones and Embedded



reply via email to

[Prev in Thread] Current Thread [Next in Thread]