[PATCH] migration: Yield coroutine when receiving MIG_CMD_POSTCOPY_LISTEN

2024-03-28 Thread Lei Wang
When using the post-copy preemption feature to perform post-copy live migration, the below scenario could lead to a deadlock and the migration will never finish: - Source connect() the preemption channel in postcopy_start(). - Source and the destination side TCP stack finished the 3-way handshak

RE: [PATCH] migration: Yield coroutine when receiving MIG_CMD_POSTCOPY_LISTEN

2024-03-29 Thread Wang, Wei W
On Friday, March 29, 2024 11:32 AM, Wang, Lei4 wrote: > When using the post-copy preemption feature to perform post-copy live > migration, the below scenario could lead to a deadlock and the migration will > never finish: > > - Source connect() the preemption channel in postcopy_start(). > - Sou

Re: [PATCH] migration: Yield coroutine when receiving MIG_CMD_POSTCOPY_LISTEN

2024-04-01 Thread Peter Xu
On Fri, Mar 29, 2024 at 08:54:07AM +, Wang, Wei W wrote: > On Friday, March 29, 2024 11:32 AM, Wang, Lei4 wrote: > > When using the post-copy preemption feature to perform post-copy live > > migration, the below scenario could lead to a deadlock and the migration > > will > > never finish: > >

Re: [PATCH] migration: Yield coroutine when receiving MIG_CMD_POSTCOPY_LISTEN

2024-04-01 Thread Fabiano Rosas
Peter Xu writes: > On Fri, Mar 29, 2024 at 08:54:07AM +, Wang, Wei W wrote: >> On Friday, March 29, 2024 11:32 AM, Wang, Lei4 wrote: >> > When using the post-copy preemption feature to perform post-copy live >> > migration, the below scenario could lead to a deadlock and the migration >> > w

Re: [PATCH] migration: Yield coroutine when receiving MIG_CMD_POSTCOPY_LISTEN

2024-04-01 Thread Peter Xu
On Mon, Apr 01, 2024 at 02:17:28PM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Fri, Mar 29, 2024 at 08:54:07AM +, Wang, Wei W wrote: > >> On Friday, March 29, 2024 11:32 AM, Wang, Lei4 wrote: > >> > When using the post-copy preemption feature to perform post-copy live > >> > migra

Re: [PATCH] migration: Yield coroutine when receiving MIG_CMD_POSTCOPY_LISTEN

2024-04-01 Thread Fabiano Rosas
Peter Xu writes: > On Mon, Apr 01, 2024 at 02:17:28PM -0300, Fabiano Rosas wrote: >> Peter Xu writes: >> >> > On Fri, Mar 29, 2024 at 08:54:07AM +, Wang, Wei W wrote: >> >> On Friday, March 29, 2024 11:32 AM, Wang, Lei4 wrote: >> >> > When using the post-copy preemption feature to perform p

Re: [PATCH] migration: Yield coroutine when receiving MIG_CMD_POSTCOPY_LISTEN

2024-04-01 Thread Wang, Lei
On 4/2/2024 0:13, Peter Xu wrote:> On Fri, Mar 29, 2024 at 08:54:07AM +, Wang, Wei W wrote: >> On Friday, March 29, 2024 11:32 AM, Wang, Lei4 wrote: >>> When using the post-copy preemption feature to perform post-copy live >>> migration, the below scenario could lead to a deadlock and the migra

RE: [PATCH] migration: Yield coroutine when receiving MIG_CMD_POSTCOPY_LISTEN

2024-04-02 Thread Wang, Wei W
On Tuesday, April 2, 2024 12:13 AM, Peter Xu wrote: > On Fri, Mar 29, 2024 at 08:54:07AM +, Wang, Wei W wrote: > > On Friday, March 29, 2024 11:32 AM, Wang, Lei4 wrote: > > > When using the post-copy preemption feature to perform post-copy > > > live migration, the below scenario could lead to

RE: [PATCH] migration: Yield coroutine when receiving MIG_CMD_POSTCOPY_LISTEN

2024-04-02 Thread Wang, Wei W
On Tuesday, April 2, 2024 2:56 PM, Wang, Lei4 wrote: > On 4/2/2024 0:13, Peter Xu wrote:> On Fri, Mar 29, 2024 at 08:54:07AM +, > Wang, Wei W wrote: > >> On Friday, March 29, 2024 11:32 AM, Wang, Lei4 wrote: > >>> When using the post-copy preemption feature to perform post-copy > >>> live migra

Re: [PATCH] migration: Yield coroutine when receiving MIG_CMD_POSTCOPY_LISTEN

2024-04-02 Thread Wang, Lei
On 4/2/2024 15:25, Wang, Wei W wrote:> On Tuesday, April 2, 2024 2:56 PM, Wang, Lei4 wrote: >> On 4/2/2024 0:13, Peter Xu wrote:> On Fri, Mar 29, 2024 at 08:54:07AM +, >> Wang, Wei W wrote: On Friday, March 29, 2024 11:32 AM, Wang, Lei4 wrote: > When using the post-copy preemption feat

Re: [PATCH] migration: Yield coroutine when receiving MIG_CMD_POSTCOPY_LISTEN

2024-04-02 Thread Peter Xu
On Tue, Apr 02, 2024 at 05:28:36PM +0800, Wang, Lei wrote: > On 4/2/2024 15:25, Wang, Wei W wrote:> On Tuesday, April 2, 2024 2:56 PM, > Wang, > Lei4 wrote: > >> On 4/2/2024 0:13, Peter Xu wrote:> On Fri, Mar 29, 2024 at 08:54:07AM > >> +, > >> Wang, Wei W wrote: > On Friday, March 29, 2

Re: [PATCH] migration: Yield coroutine when receiving MIG_CMD_POSTCOPY_LISTEN

2024-04-02 Thread Peter Xu
On Tue, Apr 02, 2024 at 07:20:01AM +, Wang, Wei W wrote: > > IIUC we still need that pre_7_2 stuff and keep the postponed connect() to > > make sure the ordering is done properly. Wei, could you elaborate the patch > > you mentioned? Maybe I missed some spots. > > Sure. I saw your patch (565

Re: [PATCH] migration: Yield coroutine when receiving MIG_CMD_POSTCOPY_LISTEN

2024-04-03 Thread Wang, Lei
On 4/3/2024 5:39, Peter Xu wrote:> > I'm not 100% sure such thing (no matter here or moved into it, which > does look cleaner) would work for us. > > The problem is I still don't yet see an ordering restricted on top of > (1) > accept() happens, and (2) receive LISTEN cm

Re: [PATCH] migration: Yield coroutine when receiving MIG_CMD_POSTCOPY_LISTEN

2024-04-03 Thread Peter Xu
On Wed, Apr 03, 2024 at 04:35:35PM +0800, Wang, Lei wrote: > We should change the following line from > > while (!qemu_sem_timedwait(&mis->postcopy_qemufile_dst_done, 100)) { > > to > > while (qemu_sem_timedwait(&mis->postcopy_qemufile_dst_done, 100)) { Stupid me.. :( Thanks for fi

RE: [PATCH] migration: Yield coroutine when receiving MIG_CMD_POSTCOPY_LISTEN

2024-04-03 Thread Wang, Wei W
On Wednesday, April 3, 2024 10:42 PM, Peter Xu wrote: > On Wed, Apr 03, 2024 at 04:35:35PM +0800, Wang, Lei wrote: > > We should change the following line from > > > > while (!qemu_sem_timedwait(&mis->postcopy_qemufile_dst_done, > 100)) { > > > > to > > > > while (qemu_sem_timedwait(&mis->p

Re: [PATCH] migration: Yield coroutine when receiving MIG_CMD_POSTCOPY_LISTEN

2024-04-03 Thread Peter Xu
On Wed, Apr 03, 2024 at 04:04:21PM +, Wang, Wei W wrote: > On Wednesday, April 3, 2024 10:42 PM, Peter Xu wrote: > > On Wed, Apr 03, 2024 at 04:35:35PM +0800, Wang, Lei wrote: > > > We should change the following line from > > > > > > while (!qemu_sem_timedwait(&mis->postcopy_qemufile_dst_don

RE: [PATCH] migration: Yield coroutine when receiving MIG_CMD_POSTCOPY_LISTEN

2024-04-04 Thread Wang, Wei W
On Thursday, April 4, 2024 12:34 AM, Peter Xu wrote: > On Wed, Apr 03, 2024 at 04:04:21PM +, Wang, Wei W wrote: > > On Wednesday, April 3, 2024 10:42 PM, Peter Xu wrote: > > > On Wed, Apr 03, 2024 at 04:35:35PM +0800, Wang, Lei wrote: > > > > We should change the following line from > > >