Re: [External] [PATCH v13 3/8] QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX

2022-06-14 Thread chuang xu
On 2022/5/13 下午2:28, Leonardo Bras wrote: @@ -557,15 +578,31 @@ static ssize_t qio_channel_socket_writev(QIOChannel *ioc, memcpy(CMSG_DATA(cmsg), fds, fdsize); } +#ifdef QEMU_MSG_ZEROCOPY +if (flags & QIO_CHANNEL_WRITE_FLAG_ZERO_COPY) { +sflags = MSG_ZEROCOPY; +

Re: [External] [PATCH v13 3/8] QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX

2022-06-13 Thread Leonardo Bras Soares Passos
On Mon, Jun 13, 2022 at 7:53 PM Peter Xu wrote: > > On Mon, Jun 13, 2022 at 05:58:44PM -0300, Leonardo Bras Soares Passos wrote: > > Hello Peter, > > > > On Wed, Jun 8, 2022 at 5:23 PM Peter Xu wrote: > > [...] > > > > In a previous iteration of the patchset, it was made clear that it's > > > >

Re: [External] [PATCH v13 3/8] QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX

2022-06-13 Thread Peter Xu
On Mon, Jun 13, 2022 at 05:58:44PM -0300, Leonardo Bras Soares Passos wrote: > Hello Peter, > > On Wed, Jun 8, 2022 at 5:23 PM Peter Xu wrote: > [...] > > > In a previous iteration of the patchset, it was made clear that it's > > > desirable to detect when the kernel falls back to copying

Re: [External] [PATCH v13 3/8] QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX

2022-06-13 Thread Leonardo Bras Soares Passos
Hello Peter, On Wed, Jun 8, 2022 at 5:23 PM Peter Xu wrote: [...] > > In a previous iteration of the patchset, it was made clear that it's > > desirable to detect when the kernel falls back to copying mechanism, > > so the user of 'QIOChannelSocket' can switch to copying and avoid the > >

Re: [External] [PATCH v13 3/8] QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX

2022-06-08 Thread Peter Xu
On Wed, Jun 08, 2022 at 03:14:36PM -0300, Leonardo Bras Soares Passos wrote: > On Wed, Jun 8, 2022 at 8:41 AM Peter Xu wrote: > > > > On Wed, Jun 08, 2022 at 02:37:28AM -0300, Leonardo Bras Soares Passos wrote: > > > (1) is not an option, as the interface currently uses ret=1 to make > > > sure

Re: [External] [PATCH v13 3/8] QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX

2022-06-08 Thread Leonardo Bras Soares Passos
On Wed, Jun 8, 2022 at 8:41 AM Peter Xu wrote: > > On Wed, Jun 08, 2022 at 02:37:28AM -0300, Leonardo Bras Soares Passos wrote: > > (1) is not an option, as the interface currently uses ret=1 to make > > sure MSG_ZEROCOPY is getting used, > > I added that so the user of qio_channel can switch off

Re: [External] [PATCH v13 3/8] QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX

2022-06-08 Thread Leonardo Bras Soares Passos
Hello Peter, On Wed, Jun 1, 2022 at 10:58 AM Peter Xu wrote: > [...] > > Hi, Leonardo. I'm also paying attention to the application of MSG_ZEROCOPY > > in live migration recently. I noticed that you defined a member > > `zero_copy_queued` in the struct QIOChannelSocket, but I can't find out > >

Re: [External] [PATCH v13 3/8] QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX

2022-06-08 Thread Peter Xu
On Wed, Jun 08, 2022 at 02:37:28AM -0300, Leonardo Bras Soares Passos wrote: > (1) is not an option, as the interface currently uses ret=1 to make > sure MSG_ZEROCOPY is getting used, > I added that so the user of qio_channel can switch off zero-copy if > it's not getting used, and save some cpu.

Re: [External] [PATCH v13 3/8] QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX

2022-06-08 Thread chuang xu
On 2022/6/8 下午1:24, Leonardo Bras Soares Passos wrote: I will send a fix shortly. Is that ok if I include a "Reported-by: 徐闯 " in the patch? okay. Best Regards, chuang xu

Re: [External] [PATCH v13 3/8] QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX

2022-06-07 Thread Leonardo Bras Soares Passos
Hello 徐闯, Thanks for reviewing! On Wed, Jun 1, 2022 at 6:37 AM 徐闯 wrote: [...] > Hi, Leonardo. I'm also paying attention to the application of > MSG_ZEROCOPY in live migration recently. I noticed that you defined a > member `zero_copy_queued` in the struct QIOChannelSocket, but I can't > find

Re: [External] [PATCH v13 3/8] QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX

2022-06-01 Thread Peter Xu
On Wed, Jun 01, 2022 at 05:37:10PM +0800, 徐闯 wrote: > > On 2022/5/13 下午2:28, Leonardo Bras wrote: > > For CONFIG_LINUX, implement the new zero copy flag and the optional callback > > io_flush on QIOChannelSocket, but enables it only when MSG_ZEROCOPY > > feature is available in the host kernel,

Re: [External] [PATCH v13 3/8] QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX

2022-06-01 Thread 徐闯
On 2022/5/13 下午2:28, Leonardo Bras wrote: For CONFIG_LINUX, implement the new zero copy flag and the optional callback io_flush on QIOChannelSocket, but enables it only when MSG_ZEROCOPY feature is available in the host kernel, which is checked on qio_channel_socket_connect_sync()