Re: [PATCH v4 3/4] migration: zero-copy flush only at the end of bitmap scanning

2022-06-21 Thread Peter Xu
On Tue, Jun 21, 2022 at 04:51:39PM +0200, Juan Quintela wrote: > > IIRC, the kernel will fall back to copying only if the network adapter / > > driver > > does not support MSG_ZEROCOPY, like when it does not support scatter-gather. > > My understanding is that it will fallback when you have too m

Re: [PATCH v4 3/4] migration: zero-copy flush only at the end of bitmap scanning

2022-06-21 Thread Peter Xu
On Tue, Jun 21, 2022 at 12:35:54AM -0300, Leonardo Brás wrote: > > This reminded me - Leo, have you considered adding the patch altogether to > > detect the "fallback to non-zero-copy" condition?  Because when with it and > > when the fallback happens at some point (e.g. when the guest memory is >

Re: [PATCH v4 3/4] migration: zero-copy flush only at the end of bitmap scanning

2022-06-21 Thread Juan Quintela
Leonardo Brás wrote: > On Mon, 2022-06-20 at 11:44 -0400, Peter Xu wrote: >> On Mon, Jun 20, 2022 at 11:23:53AM +0200, Juan Quintela wrote: >> > Once discussed this, what I asked in the past is that you are having too >> > much dirty memory on zero_copy.  When you have a Multiterabyte guest, in >>

Re: [PATCH v4 3/4] migration: zero-copy flush only at the end of bitmap scanning

2022-06-20 Thread Leonardo Brás
On Mon, 2022-06-20 at 11:44 -0400, Peter Xu wrote: > On Mon, Jun 20, 2022 at 11:23:53AM +0200, Juan Quintela wrote: > > Once discussed this, what I asked in the past is that you are having too > > much dirty memory on zero_copy.  When you have a Multiterabyte guest, in > > a single round you have a

Re: [PATCH v4 3/4] migration: zero-copy flush only at the end of bitmap scanning

2022-06-20 Thread Leonardo Brás
On Mon, 2022-06-20 at 11:23 +0200, Juan Quintela wrote: > Leonardo Bras wrote: > > When sending memory pages with MSG_ZEROCOPY, it's necessary to flush > > to make sure all dirty pages are sent before a future version of them > > happens to be sent. > > > > Currently, the flush happens every time

Re: [PATCH v4 3/4] migration: zero-copy flush only at the end of bitmap scanning

2022-06-20 Thread Peter Xu
On Mon, Jun 20, 2022 at 11:23:53AM +0200, Juan Quintela wrote: > Once discussed this, what I asked in the past is that you are having too > much dirty memory on zero_copy. When you have a Multiterabyte guest, in > a single round you have a "potentially" dirty memory on each channel of: > >tot

Re: [PATCH v4 3/4] migration: zero-copy flush only at the end of bitmap scanning

2022-06-20 Thread Juan Quintela
Leonardo Bras wrote: > When sending memory pages with MSG_ZEROCOPY, it's necessary to flush > to make sure all dirty pages are sent before a future version of them > happens to be sent. > > Currently, the flush happens every time at the end of ram_save_iterate(), > which usually happens around 20x

[PATCH v4 3/4] migration: zero-copy flush only at the end of bitmap scanning

2022-06-19 Thread Leonardo Bras
When sending memory pages with MSG_ZEROCOPY, it's necessary to flush to make sure all dirty pages are sent before a future version of them happens to be sent. Currently, the flush happens every time at the end of ram_save_iterate(), which usually happens around 20x per second, due to a timeout. C