qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Leonardo Bras Soares Passos <leobras@redhat.com>
To: Peter Xu <peterx@redhat.com>
Cc: "Elena Ufimtseva" <elena.ufimtseva@oracle.com>,
	"John G Johnson" <john.g.johnson@oracle.com>,
	"Jagannathan Raman" <jag.raman@oracle.com>,
	qemu-block@nongnu.org, "Juan Quintela" <quintela@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Fam Zheng" <fam@euphon.net>, "Eric Blake" <eblake@redhat.com>
Subject: Re: [PATCH v9 7/7] multifd: Implement zero copy write in multifd migration (multifd-zero-copy)
Date: Tue, 26 Apr 2022 19:58:09 -0300	[thread overview]
Message-ID: <CAJ6HWG6Qu_-RV42Aj17gONHA5seUfPFmzLzmPf9-TuG=64Yhcw@mail.gmail.com> (raw)
In-Reply-To: <YmgXhEI0AdQ2SILO@xz-m1.local>

Hello Peter, thanks for helping!

On Tue, Apr 26, 2022 at 1:02 PM Peter Xu <peterx@redhat.com> wrote:
>
> Leo,
>
> This patch looks mostly good to me, a few nitpicks below.
>
> On Mon, Apr 25, 2022 at 06:50:56PM -0300, Leonardo Bras wrote:
[...]
> >      }
> > +
> > +    /*
> > +     * 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();
>
> Would you mind inline it if it's only used once?

It's not obvious in the diff, but this is used in a loop bellow, so I inserted
the variable to avoid calling migrate_use_zero_copy_send() for each
multifd channel.

>
> It's great to have that comment, but IMHO it could be more explicit, even
> marking a TODO showing that maybe we could do better in the future:
>
>   /*
>    * When using zero-copy, it's necessary to flush the pages before any of
>    * the pages can be sent again, so we'll make sure the new version of the
>    * pages will always arrive _later_ than the old pages.
>    *
>    * Currently we achieve this by flushing the zero-page requested writes
>    * per ram iteration, but in the future we could potentially optimize it
>    * to be less frequent, e.g. only after we finished one whole scanning of
>    * all the dirty bitmaps.
>    */
>

Thanks! I will insert that in the next version.

The thing here is that I was under the impression an iteration was equivalent to
a whole scanning of all the dirty bitmaps. I see now that it may not
be the case.

[...]
> > @@ -688,10 +708,9 @@ static void *multifd_send_thread(void *opaque)
> >                  p->iov[0].iov_base = p->packet;
> >              }
> >
> > -            ret = qio_channel_writev_all(p->c, p->iov + iov_offset,
> > -                                         p->iovs_num - iov_offset,
> > -                                         &local_err);
> > -
> > +            ret = qio_channel_writev_full_all(p->c, p->iov + iov_offset,
> > +                                              p->iovs_num - iov_offset, NULL,
> > +                                              0, p->write_flags, &local_err);
>
> I kind of agree with Dan in previous patch - this iov_offset is confusing,
> better drop it.

Sure, fixed for v10.

>
[...]
> --
> Peter Xu
>

Best regards,
Leo



      reply	other threads:[~2022-04-26 22:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-25 21:50 [PATCH v9 0/7] MSG_ZEROCOPY + multifd Leonardo Bras
2022-04-25 21:50 ` [PATCH v9 1/7] QIOChannel: Add flags on io_writev and introduce io_flush callback Leonardo Bras
2022-04-25 21:50 ` [PATCH v9 2/7] QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX Leonardo Bras
2022-04-25 21:50 ` [PATCH v9 3/7] migration: Add zero-copy-send parameter for QMP/HMP for Linux Leonardo Bras
2022-05-04 10:48   ` Markus Armbruster
2022-05-04 17:19     ` Leonardo Bras Soares Passos
2022-04-25 21:50 ` [PATCH v9 4/7] migration: Add migrate_use_tls() helper Leonardo Bras
2022-04-25 21:50 ` [PATCH v9 5/7] multifd: multifd_send_sync_main now returns negative on error Leonardo Bras
2022-04-26  8:01   ` Daniel P. Berrangé
2022-04-26 12:59   ` Peter Xu
2022-04-26 16:08     ` Leonardo Bras Soares Passos
2022-04-25 21:50 ` [PATCH v9 6/7] multifd: Send header packet without flags if zero-copy-send is enabled Leonardo Bras
2022-04-26  8:10   ` Daniel P. Berrangé
2022-04-26 21:59     ` Leonardo Bras Soares Passos
2022-04-25 21:50 ` [PATCH v9 7/7] multifd: Implement zero copy write in multifd migration (multifd-zero-copy) Leonardo Bras
2022-04-26 16:02   ` Peter Xu
2022-04-26 22:58     ` Leonardo Bras Soares Passos [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ6HWG6Qu_-RV42Aj17gONHA5seUfPFmzLzmPf9-TuG=64Yhcw@mail.gmail.com' \
    --to=leobras@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=elena.ufimtseva@oracle.com \
    --cc=fam@euphon.net \
    --cc=jag.raman@oracle.com \
    --cc=john.g.johnson@oracle.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).