diff mbox series

[v18,QEMU,2/3] virtio-balloon: Add support for providing free page reports to host

Message ID 20200408225523.18764.86514.stgit@localhost.localdomain
State New
Headers show
Series virtio-balloon: add support for providing free page reporting | expand

Commit Message

Alexander Duyck April 8, 2020, 10:55 p.m. UTC
From: Alexander Duyck <alexander.h.duyck@linux.intel.com>

Add support for the page reporting feature provided by virtio-balloon.
Reporting differs from the regular balloon functionality in that is is
much less durable than a standard memory balloon. Instead of creating a
list of pages that cannot be accessed the pages are only inaccessible
while they are being indicated to the virtio interface. Once the
interface has acknowledged them they are placed back into their respective
free lists and are once again accessible by the guest system.

Unlike a standard balloon we don't inflate and deflate the pages. Instead
we perform the reporting, and once the reporting is completed it is
assumed that the page has been dropped from the guest and will be faulted
back in the next time the page is accessed.

This patch is a subset of the UAPI patch that was submitted for the Linux
kernel. The original patch can be found at:
https://lore.kernel.org/lkml/20200211224657.29318.68624.stgit@localhost.localdomain/

Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
---
 include/standard-headers/linux/virtio_balloon.h |    1 +
 1 file changed, 1 insertion(+)

Comments

David Hildenbrand April 9, 2020, 7:35 a.m. UTC | #1
On 09.04.20 00:55, Alexander Duyck wrote:
> From: Alexander Duyck <alexander.h.duyck@linux.intel.com>
> 
> Add support for the page reporting feature provided by virtio-balloon.
> Reporting differs from the regular balloon functionality in that is is
> much less durable than a standard memory balloon. Instead of creating a
> list of pages that cannot be accessed the pages are only inaccessible
> while they are being indicated to the virtio interface. Once the
> interface has acknowledged them they are placed back into their respective
> free lists and are once again accessible by the guest system.
> 
> Unlike a standard balloon we don't inflate and deflate the pages. Instead
> we perform the reporting, and once the reporting is completed it is
> assumed that the page has been dropped from the guest and will be faulted
> back in the next time the page is accessed.
> 
> This patch is a subset of the UAPI patch that was submitted for the Linux
> kernel. The original patch can be found at:
> https://lore.kernel.org/lkml/20200211224657.29318.68624.stgit@localhost.localdomain/

You don't need all these comments.

Usually we do

"linux-headers: update to contain virito-balloon free page reporting

Let's sync the latest upstream changes for free page reporting. To be
replaced by a full linux header sync.

Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
"

mst will replace this by a full header sync (if necessary) when sending
it upstream
Alexander Duyck April 9, 2020, 2:41 p.m. UTC | #2
On Thu, Apr 9, 2020 at 12:36 AM David Hildenbrand <david@redhat.com> wrote:
>
> On 09.04.20 00:55, Alexander Duyck wrote:
> > From: Alexander Duyck <alexander.h.duyck@linux.intel.com>
> >
> > Add support for the page reporting feature provided by virtio-balloon.
> > Reporting differs from the regular balloon functionality in that is is
> > much less durable than a standard memory balloon. Instead of creating a
> > list of pages that cannot be accessed the pages are only inaccessible
> > while they are being indicated to the virtio interface. Once the
> > interface has acknowledged them they are placed back into their respective
> > free lists and are once again accessible by the guest system.
> >
> > Unlike a standard balloon we don't inflate and deflate the pages. Instead
> > we perform the reporting, and once the reporting is completed it is
> > assumed that the page has been dropped from the guest and will be faulted
> > back in the next time the page is accessed.
> >
> > This patch is a subset of the UAPI patch that was submitted for the Linux
> > kernel. The original patch can be found at:
> > https://lore.kernel.org/lkml/20200211224657.29318.68624.stgit@localhost.localdomain/
>
> You don't need all these comments.

Sorry about that. Those are basically the same comments from the
original upstream patch. I just wasn't aware of the process so I just
copied that over and added the comment/link to the original patch.

> Usually we do
>
> "linux-headers: update to contain virito-balloon free page reporting
>
> Let's sync the latest upstream changes for free page reporting. To be
> replaced by a full linux header sync.
>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
> "
>
> mst will replace this by a full header sync (if necessary) when sending
> it upstream

I will update the patch description.

Thanks.

- Alex
David Hildenbrand April 9, 2020, 2:43 p.m. UTC | #3
On 09.04.20 16:41, Alexander Duyck wrote:
> On Thu, Apr 9, 2020 at 12:36 AM David Hildenbrand <david@redhat.com> wrote:
>>
>> On 09.04.20 00:55, Alexander Duyck wrote:
>>> From: Alexander Duyck <alexander.h.duyck@linux.intel.com>
>>>
>>> Add support for the page reporting feature provided by virtio-balloon.
>>> Reporting differs from the regular balloon functionality in that is is
>>> much less durable than a standard memory balloon. Instead of creating a
>>> list of pages that cannot be accessed the pages are only inaccessible
>>> while they are being indicated to the virtio interface. Once the
>>> interface has acknowledged them they are placed back into their respective
>>> free lists and are once again accessible by the guest system.
>>>
>>> Unlike a standard balloon we don't inflate and deflate the pages. Instead
>>> we perform the reporting, and once the reporting is completed it is
>>> assumed that the page has been dropped from the guest and will be faulted
>>> back in the next time the page is accessed.
>>>
>>> This patch is a subset of the UAPI patch that was submitted for the Linux
>>> kernel. The original patch can be found at:
>>> https://lore.kernel.org/lkml/20200211224657.29318.68624.stgit@localhost.localdomain/
>>
>> You don't need all these comments.
> 
> Sorry about that. Those are basically the same comments from the
> original upstream patch. I just wasn't aware of the process so I just
> copied that over and added the comment/link to the original patch.

No worries, it just felt like "oh, he spent a lot of time writing this,
but after all it wasn't necessary" :)
diff mbox series

Patch

diff --git a/include/standard-headers/linux/virtio_balloon.h b/include/standard-headers/linux/virtio_balloon.h
index 9375ca2a70de..1c5f6d6f2de6 100644
--- a/include/standard-headers/linux/virtio_balloon.h
+++ b/include/standard-headers/linux/virtio_balloon.h
@@ -36,6 +36,7 @@ 
 #define VIRTIO_BALLOON_F_DEFLATE_ON_OOM	2 /* Deflate balloon on OOM */
 #define VIRTIO_BALLOON_F_FREE_PAGE_HINT	3 /* VQ to report free pages */
 #define VIRTIO_BALLOON_F_PAGE_POISON	4 /* Guest is using page poisoning */
+#define VIRTIO_BALLOON_F_REPORTING	5 /* Page reporting virtqueue */
 
 /* Size of a PFN in the balloon interface. */
 #define VIRTIO_BALLOON_PFN_SHIFT 12