[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 4/4] migration/multifd/zero-copy: Flush only the LRU half
From: |
Daniel P . Berrangé |
Subject: |
Re: [RFC PATCH 4/4] migration/multifd/zero-copy: Flush only the LRU half of the header array |
Date: |
Tue, 25 Oct 2022 09:35:55 +0100 |
User-agent: |
Mutt/2.2.7 (2022-08-07) |
On Tue, Oct 25, 2022 at 01:47:31AM -0300, Leonardo Bras wrote:
> Zero-copy multifd migration sends both the header and the memory pages in a
> single syscall. Since it's necessary to flush before reusing the header, a
> header array was implemented, so each write call uses a different
> array, and flushing only take place after all headers have been used,
> meaning 1 flush for each N writes.
>
> This method has a bottleneck, though: After the last write, a flush will
> have to wait for all writes to finish, which will be a lot, meaning the
> recvmsg() syscall called in qio_channel_socket_flush() will be called a
> lot. On top of that, it will create a time period when the I/O queue is
> empty and nothing is getting send: between the flush and the next write.
>
> To avoid that, use qio_channel_flush()'s new max_pending parameter to wait
> until at most half of the array is still in use. (i.e. the LRU half of the
> array can be reused)
>
> Flushing for the LRU half of the array is much faster, since it does not
> have to wait for the most recent writes to finish, making up for having
> to flush twice per array.
>
> As a main benefit, this approach keeps the I/O queue from being empty while
> there are still data to be sent, making it easier to keep the I/O maximum
> throughput while consuming less cpu time.
Doesn't this defeat the reason for adding the flush in the first
place, which was to ensure that a migration iteration was fully
sent before starting the next iteration over RAM ? If it is OK to
only partially flush on each iteration, then why do we need to
flush at all ?
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- [RFC PATCH 0/4] MultiFD zero-copy improvements, Leonardo Bras, 2022/10/25
- [RFC PATCH 3/4] QIOChannel: Add max_pending parameter to qio_channel_flush(), Leonardo Bras, 2022/10/25
- [RFC PATCH 2/4] migration/multifd/zero-copy: Merge header & pages send in a single write, Leonardo Bras, 2022/10/25
- [RFC PATCH 1/4] migration/multifd/zero-copy: Create helper function for flushing, Leonardo Bras, 2022/10/25
- [RFC PATCH 4/4] migration/multifd/zero-copy: Flush only the LRU half of the header array, Leonardo Bras, 2022/10/25
- Re: [RFC PATCH 4/4] migration/multifd/zero-copy: Flush only the LRU half of the header array,
Daniel P . Berrangé <=
- Re: [RFC PATCH 0/4] MultiFD zero-copy improvements, Peter Xu, 2022/10/25