Message ID | c799b1f96e55c5eb9c07e5a70a51b8ba67e7bcc9.1731128180.git.yong.huang@smartx.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | migration: Skip the first dirty sync | expand |
On 09.11.24 05:59, Hyman Huang wrote: > PRECOPY_NOTIFY_AFTER_BITMAP_SYNC was interpreted by free page hinting > optimization as an indication to begin freeing pages. But there's no > assurance that a sync is required when beginning a migration. Therefore, > during PRECOPY_NOTIFY_SETUP, as well as PRECOPY_NOTIFY_AFTER_BITMAP_SYNC, > enable free page hinting. But what does this change bring us in practice? How was it tested that this makes any difference?
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 609e39a821..2f1e086cd8 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -663,6 +663,7 @@ virtio_balloon_free_page_hint_notify(NotifierWithReturn *n, void *data, case PRECOPY_NOTIFY_BEFORE_BITMAP_SYNC: virtio_balloon_free_page_stop(dev); break; + case PRECOPY_NOTIFY_SETUP: case PRECOPY_NOTIFY_AFTER_BITMAP_SYNC: if (vdev->vm_running) { virtio_balloon_free_page_start(dev); @@ -679,7 +680,6 @@ virtio_balloon_free_page_hint_notify(NotifierWithReturn *n, void *data, */ virtio_balloon_free_page_done(dev); break; - case PRECOPY_NOTIFY_SETUP: case PRECOPY_NOTIFY_COMPLETE: break; default:
PRECOPY_NOTIFY_AFTER_BITMAP_SYNC was interpreted by free page hinting optimization as an indication to begin freeing pages. But there's no assurance that a sync is required when beginning a migration. Therefore, during PRECOPY_NOTIFY_SETUP, as well as PRECOPY_NOTIFY_AFTER_BITMAP_SYNC, enable free page hinting. Signed-off-by: Hyman Huang <yong.huang@smartx.com> --- hw/virtio/virtio-balloon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)