Re: [PATCH v6 2/2] Unify how inflated memory is accounted in virtio balloon driver

From: David Hildenbrand
Date: Mon Aug 01 2022 - 11:13:28 EST


On 26.07.22 16:10, Alexander Atanasov wrote:
> Always account inflated memory as used for both cases - with and
> without deflate on oom. Do not change total ram which can confuse
> userspace and users.

Sorry, but NAK.

This would affect existing users / user space / balloon stats. For example
HV just recently switch to properly using adjust_managed_page_count()


commit d1df458cbfdb0c3384c03c7fbcb1689bc02a746c
Author: Vitaly Kuznetsov <vkuznets@xxxxxxxxxx>
Date: Wed Dec 2 17:12:45 2020 +0100

hv_balloon: do adjust_managed_page_count() when ballooning/un-ballooning

Unlike virtio_balloon/virtio_mem/xen balloon drivers, Hyper-V balloon driver
does not adjust managed pages count when ballooning/un-ballooning and this leads
to incorrect stats being reported, e.g. unexpected 'free' output.

Note, the calculation in post_status() seems to remain correct: ballooned out
pages are never 'available' and we manually add dm->num_pages_ballooned to
'commited'.


--
Thanks,

David / dhildenb