RE: use of shrinker in virtio balloon free page hinting
From: Wang, Wei W
Date: Wed Jul 17 2019 - 11:47:01 EST
On Wednesday, July 17, 2019 7:21 PM, Michael S. Tsirkin wrote:
>
> Wei, others,
>
> ATM virtio_balloon_shrinker_scan will only get registered when deflate on
> oom feature bit is set.
>
> Not sure whether that's intentional.
Yes, we wanted to follow the old oom behavior, which allows the oom notifier
to deflate pages only when this feature bit has been negotiated.
> Assuming it is:
>
> virtio_balloon_shrinker_scan will try to locate and free pages that are
> processed by host.
> The above seems broken in several ways:
> - count ignores the free page list completely
Do you mean virtio_balloon_shrinker_count()? It just reports to
do_shrink_slab the amount of freeable memory that balloon has.
(vb->num_pages and vb->num_free_page_blocks are all included )
> - if free pages are being reported, pages freed
> by shrinker will just get re-allocated again
fill_balloon will re-try the allocation after sleeping 200ms once allocation fails.
> I was unable to make this part of code behave in any reasonable way - was
> shrinker usage tested? What's a good way to test that?
Please see the example that I tested before : https://lkml.org/lkml/2018/8/6/29
(just the first one: *1. V3 patches)
What problem did you see?
I just tried the latest code, and find ballooning reports a #GP (seems caused by
418a3ab1e).
I'll take a look at the details in the office tomorrow.
Best,
Wei