This patch series intends to enable MSG_ZEROCOPY in QIOChannel, and make use of it for multifd migration performance improvement.
Patch #1 enables the use of flags on qio_channel_write*(), allowing more flexibility in using the channel. It was designed for MSG_ZEROCOPY usage, in which it's a good idea having a eassy way to choose what packets are sent with the flag, but also makes it more flexible for future usage. Patch #2 just adds the MSG_ZEROCOPY feature, and defines the enablement mechanics, while not enabling it in any code. Patch #3 enables MSG_ZEROCOPY for migration / multifd. Results: So far, the resource usage of __sys_sendmsg() reduced 15 times, and the overall migration took 13-18% less time, based in synthetic workload. The objective is to reduce migration time in hosts with heavy cpu usage. Leonardo Bras (3): io: Enable write flags for QIOChannel io: Add zerocopy and errqueue migration: multifd: Enable zerocopy chardev/char-io.c | 2 +- hw/remote/mpqemu-link.c | 2 +- include/io/channel-socket.h | 2 + include/io/channel.h | 85 +++++++++++++++++++++++------ io/channel-buffer.c | 1 + io/channel-command.c | 1 + io/channel-file.c | 1 + io/channel-socket.c | 80 ++++++++++++++++++++++++++- io/channel-tls.c | 12 ++++ io/channel-websock.c | 10 ++++ io/channel.c | 64 +++++++++++++--------- migration/multifd-zlib.c | 7 ++- migration/multifd-zstd.c | 7 ++- migration/multifd.c | 9 ++- migration/multifd.h | 3 +- migration/rdma.c | 1 + scsi/pr-manager-helper.c | 2 +- tests/unit/test-io-channel-socket.c | 1 + 18 files changed, 235 insertions(+), 55 deletions(-) -- 2.33.0