David Hildenbrand
2020-Apr-17 10:26 UTC
[virtio-dev] Re: [PATCH] virtio-balloon: Disable free page hinting/reporting if page poison is disabled
On 17.04.20 12:19, Michael S. Tsirkin wrote:> On Fri, Apr 17, 2020 at 12:09:38PM +0200, David Hildenbrand wrote: >> > What do you call "hinting ends" though? The fact we put >>> a page in the VQ is not a guarantee that it's been consumed >>> by the hypervisor. >>> >> >> I'd say hinting ends once the hypervisor sets FREE_PAGE_REPORT_S_DONE. > > Can't find that one anywhere. what did I miss?Sorry, the QEMU implementation is confusing. FREE_PAGE_REPORT_S_DONE is translated to VIRTIO_BALLOON_CMD_ID_DONE QEMU: hw/virtio/virtio-balloon.c:virtio_balloon_free_page_report_notify() -> virtio_balloon_free_page_done(dev) -> s->free_page_report_status = FREE_PAGE_REPORT_S_DONE; virtio_notify_config(vdev); When the guest reads the config hw/virtio/virtio-balloon.c:virtio_balloon_get_config() -> if (dev->free_page_report_status == FREE_PAGE_REPORT_S_DONE) -> config.free_page_report_cmd_id = ... VIRTIO_BALLOON_CMD_ID_DONE Linux: drivers/virtio/virtio_balloon.c:report_free_page_func() -> if (cmd_id_received == VIRTIO_BALLOON_CMD_ID_DONE) { -> return_free_pages_to_mm() So it's VIRTIO_BALLOON_CMD_ID_DONE. -- Thanks, David / dhildenb
Michael S. Tsirkin
2020-Apr-17 10:29 UTC
[virtio-dev] Re: [PATCH] virtio-balloon: Disable free page hinting/reporting if page poison is disabled
On Fri, Apr 17, 2020 at 12:26:24PM +0200, David Hildenbrand wrote:> On 17.04.20 12:19, Michael S. Tsirkin wrote: > > On Fri, Apr 17, 2020 at 12:09:38PM +0200, David Hildenbrand wrote: > >> > What do you call "hinting ends" though? The fact we put > >>> a page in the VQ is not a guarantee that it's been consumed > >>> by the hypervisor. > >>> > >> > >> I'd say hinting ends once the hypervisor sets FREE_PAGE_REPORT_S_DONE. > > > > Can't find that one anywhere. what did I miss? > > Sorry, the QEMU implementation is confusing. FREE_PAGE_REPORT_S_DONE is > translated to VIRTIO_BALLOON_CMD_ID_DONEWell VIRTIO_BALLOON_CMD_ID_DONE just means "don't give me any more hints, I finished migration". Guest will stop hinting even without that once it scans all free memory.> QEMU: > > hw/virtio/virtio-balloon.c:virtio_balloon_free_page_report_notify() > -> virtio_balloon_free_page_done(dev) > -> s->free_page_report_status = FREE_PAGE_REPORT_S_DONE; > virtio_notify_config(vdev); > > When the guest reads the config > hw/virtio/virtio-balloon.c:virtio_balloon_get_config() > -> if (dev->free_page_report_status == FREE_PAGE_REPORT_S_DONE) > -> config.free_page_report_cmd_id = ... VIRTIO_BALLOON_CMD_ID_DONE > > > Linux: > > drivers/virtio/virtio_balloon.c:report_free_page_func() > -> if (cmd_id_received == VIRTIO_BALLOON_CMD_ID_DONE) { > -> return_free_pages_to_mm() > > > So it's VIRTIO_BALLOON_CMD_ID_DONE. > > > -- > Thanks, > > David / dhildenb
David Hildenbrand
2020-Apr-17 10:31 UTC
[virtio-dev] Re: [PATCH] virtio-balloon: Disable free page hinting/reporting if page poison is disabled
On 17.04.20 12:29, Michael S. Tsirkin wrote:> On Fri, Apr 17, 2020 at 12:26:24PM +0200, David Hildenbrand wrote: >> On 17.04.20 12:19, Michael S. Tsirkin wrote: >>> On Fri, Apr 17, 2020 at 12:09:38PM +0200, David Hildenbrand wrote: >>>> > What do you call "hinting ends" though? The fact we put >>>>> a page in the VQ is not a guarantee that it's been consumed >>>>> by the hypervisor. >>>>> >>>> >>>> I'd say hinting ends once the hypervisor sets FREE_PAGE_REPORT_S_DONE. >>> >>> Can't find that one anywhere. what did I miss? >> >> Sorry, the QEMU implementation is confusing. FREE_PAGE_REPORT_S_DONE is >> translated to VIRTIO_BALLOON_CMD_ID_DONE > > Well VIRTIO_BALLOON_CMD_ID_DONE just means "don't give me any > more hints, I finished migration". > Guest will stop hinting even without that once it scans all > free memory.Yeah, that's the end of the whole process where you can be sure the host processed all requests definetly. -- Thanks, David / dhildenb
Maybe Matching Threads
- [virtio-dev] Re: [PATCH] virtio-balloon: Disable free page hinting/reporting if page poison is disabled
- [virtio-dev] Re: [PATCH] virtio-balloon: Disable free page hinting/reporting if page poison is disabled
- [virtio-dev] Re: [PATCH] virtio-balloon: Disable free page hinting/reporting if page poison is disabled
- [virtio-dev] Re: [PATCH] virtio-balloon: Disable free page hinting/reporting if page poison is disabled
- [virtio-dev] Re: [PATCH] virtio-balloon: Disable free page hinting/reporting if page poison is disabled