Re: [PATCH] virtio_balloon: high order allocation

From: David Hildenbrand
Date: Fri Dec 23 2022 - 04:41:09 EST


On 23.12.22 10:35, Soichiro Ueda wrote:
At present, the VirtIO balloon device driver allocates pages
one by one using alloc_page(), and frees them using put_page().

This changes it so that the driver allocates high order pages
by using alloc_pages(), and frees them using __free_pages() if possible.
By doing so, the CPU performance of inflation and deflation
should be improved.

The effect of this change has been confirmed by benchmarks that measure
the elapsed time of inflation and deflation.

The results are here:

16 pages inflation:
before: 119,779 ns
after : 115,655 ns (-3.4%)
64 pages inflation:
before: 156,977 ns
after : 150,961 ns (-3.8%)
256 pages inflation:
before: 218,649 ns
after : 208,490 ns (-4.6%)
16 pages deflation:
before: 78,112 ns
after : 68,288 ns (-12.6%)
64 pages deflation:
before: 97,205 ns
after : 80,491 ns (-17.194%)
256 pages deflation:
before: 122,742 ns
after : 107,526 ns (-12.4%)

How does this affect page migration / balloon compaction etc?

--
Thanks,

David / dhildenb