[RFC PATCH 0/4] MultiFD zero-copy improvements

Leonardo Bras posted 4 patches 1 year, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20221025044730.319941-1-leobras@redhat.com
Maintainers: "Daniel P. Berrangé" <berrange@redhat.com>, Juan Quintela <quintela@redhat.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>
include/io/channel.h |  7 +++-
migration/multifd.h  |  5 ++-
io/channel-socket.c  |  5 ++-
io/channel.c         |  5 ++-
migration/multifd.c  | 88 ++++++++++++++++++++++++++------------------
5 files changed, 68 insertions(+), 42 deletions(-)
[RFC PATCH 0/4] MultiFD zero-copy improvements
Posted by Leonardo Bras 1 year, 6 months ago
RFC for an improvement suggested by Juan during the KVM Forum and a few
optimizations I found in the way.

Patch #1 is just moving code to a helper, should have no impact.

Patch #2 is my implementation of Juan's suggestion. I implemented the
simplest way I thought on the array size: a fixed defined value.
I am not sure if this is fine, or if the array size should be either
informed by the user either via QMP or cmdline.
That's an important point I really need feedback on.

Patch #3: Improve the qio_channel_flush() interface to accept flush
waiting for some writes finished instead of all of them. This reduces
the waiting time, since most recent writes/sends will take more time to
finish, while the older ones are probably finished by the first recvmsg()
syscall return.

Patch #4 uses #3 in multifd zero-copy. It flushes the LRU half of the
header array, allowing more writes to happen while the most recent ones
are ongoing, instead of waiting for everything to finish before sending
more.

It all works fine in my tests, but maybe I missed some cornercase.
Please provide any feedback you find fit.

Thank you all!

Best regards,
Leo

Leonardo Bras (4):
  migration/multifd/zero-copy: Create helper function for flushing
  migration/multifd/zero-copy: Merge header & pages send in a single
    write
  QIOChannel: Add max_pending parameter to qio_channel_flush()
  migration/multifd/zero-copy: Flush only the LRU half of the header
    array

 include/io/channel.h |  7 +++-
 migration/multifd.h  |  5 ++-
 io/channel-socket.c  |  5 ++-
 io/channel.c         |  5 ++-
 migration/multifd.c  | 88 ++++++++++++++++++++++++++------------------
 5 files changed, 68 insertions(+), 42 deletions(-)

-- 
2.38.0
Re: [RFC PATCH 0/4] MultiFD zero-copy improvements
Posted by Peter Xu 1 year, 6 months ago
On Tue, Oct 25, 2022 at 01:47:27AM -0300, Leonardo Bras wrote:
> It all works fine in my tests, but maybe I missed some cornercase.
> Please provide any feedback you find fit.

Personally I very much like the whole series. :)

I just want to make sure it won't start to fail users when switching to
this new version of qemu due to vmlocked restrictions which I expect to
grow.  But I see that there're discussions on patch 4 for further
optimizations of lockvm and let's keep the discussion there for this.

The other thing is since it's a patchset for performance optimization only,
it'll always be nice to attach performance numbers.  If on slow networks it
won't show a difference worth mentioning that.  And ultimately I believe
anyone would be interested to know in which case (e.g. 100g nic?) would
this start to benefit.

Thanks!

-- 
Peter Xu