Re: [PATCH v1 1/1] Create debugfs file with hyper-v balloon usage information

From: Denis V. Lunev
Date: Tue Jul 05 2022 - 13:31:47 EST


On 05.07.2022 19:12, Michael Kelley (LINUX) wrote:
From: Alexander Atanasov <alexander.atanasov@xxxxxxxxxxxxx> Sent: Tuesday, July 5, 2022 2:44 AM
Allow the guest to know how much it is ballooned by the host.
It is useful when debugging out of memory conditions.

When host gets back memory from the guest it is accounted
as used memory in the guest but the guest have no way to know
how much it is actually ballooned.

Expose current state, flags and max possible memory to the guest.
Thanks for the contribution! I can see it being useful. But I'd note
that the existing code has a trace function that outputs pretty much all
the same information when it is reported to the Hyper-V host in
post_status() every 1 second. However, the debugfs interface might be
a bit easier to use for ongoing sampling. Related, I see that the VMware
balloon driver use the debugfs interface, but no tracing. The virtio
balloon driver has neither. I'm not against adding this debugfs interface,
but I wanted to make sure there's real value over the existing tracing.

See also some minor comments below.
virtio efforts:
https://www.spinics.net/lists/kernel/msg4425155.html

In general balloon information is always reported to the host, that is why
balloon is invented. Though the information inside the guest is not
always available and it is hard to track/guess.

We have had a lot of trouble to convince our customers that the
memory was taken by host being inside virtual machine. Thus debugfs
interface is good for such rare checks especially keeping in mind
that this would be the same for most frequently used by us
balloons.

Den