[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v8 5/5] multifd: Implement zero copy write in multifd migrati
From: |
Peter Xu |
Subject: |
Re: [PATCH v8 5/5] multifd: Implement zero copy write in multifd migration (multifd-zero-copy) |
Date: |
Tue, 8 Feb 2022 10:22:16 +0800 |
On Tue, Feb 01, 2022 at 03:29:03AM -0300, Leonardo Bras wrote:
> -void multifd_send_sync_main(QEMUFile *f)
> +int multifd_send_sync_main(QEMUFile *f)
> {
> int i;
> + bool flush_zero_copy;
>
> if (!migrate_use_multifd()) {
> - return;
> + return 0;
> }
> if (multifd_send_state->pages->num) {
> if (multifd_send_pages(f) < 0) {
> error_report("%s: multifd_send_pages fail", __func__);
> - return;
> + return 0;
I've not checked how it used to do if multifd_send_pages() failed, but.. should
it returns -1 rather than 0 when there will be a return code?
> }
> }
> +
> + /*
> + * When using zero-copy, it's necessary to flush after each iteration to
> + * make sure pages from earlier iterations don't end up replacing newer
> + * pages.
> + */
> + flush_zero_copy = migrate_use_zero_copy_send();
> +
> for (i = 0; i < migrate_multifd_channels(); i++) {
> MultiFDSendParams *p = &multifd_send_state->params[i];
>
> @@ -591,7 +600,7 @@ void multifd_send_sync_main(QEMUFile *f)
> if (p->quit) {
> error_report("%s: channel %d has already quit", __func__, i);
> qemu_mutex_unlock(&p->mutex);
> - return;
> + return 0;
Same question here.
> }
The rest looks good. Thanks,
--
Peter Xu
[PATCH v8 3/5] migration: Add zero-copy-send parameter for QMP/HMP for Linux, Leonardo Bras, 2022/02/01