Re: [PATCH v3 06/33] util/async: aio_co_schedule(): support reschedule in same ctx

2021-06-09 Thread Paolo Bonzini
On 09/06/21 12:24, Vladimir Sementsov-Ogievskiy wrote: Thanks, I'll base v4 of nbd patches on it. I now run make check. test-aio-multithread crashes on assertion: With the patch I've sent it doesn't, so hopefully you can go ahead. Paolo (gdb) bt #0  0x7f4af8d839d5 in raise () from /lib6

Re: [PATCH v3 06/33] util/async: aio_co_schedule(): support reschedule in same ctx

2021-06-09 Thread Vladimir Sementsov-Ogievskiy
09.06.2021 12:35, Paolo Bonzini wrote: On 08/06/21 20:45, Vladimir Sementsov-Ogievskiy wrote: 14.05.2021 00:04, Paolo Bonzini wrote: On 12/05/21 09:15, Vladimir Sementsov-Ogievskiy wrote: I don't understand.  Why doesn't aio_co_enter go through the ctx != qemu_get_current_aio_context() bra

Re: [PATCH v3 06/33] util/async: aio_co_schedule(): support reschedule in same ctx

2021-06-09 Thread Paolo Bonzini
On 08/06/21 20:45, Vladimir Sementsov-Ogievskiy wrote: 14.05.2021 00:04, Paolo Bonzini wrote: On 12/05/21 09:15, Vladimir Sementsov-Ogievskiy wrote: I don't understand.  Why doesn't aio_co_enter go through the ctx != qemu_get_current_aio_context() branch and just do aio_co_schedule? That w

Re: [PATCH v3 06/33] util/async: aio_co_schedule(): support reschedule in same ctx

2021-06-08 Thread Vladimir Sementsov-Ogievskiy
14.05.2021 00:04, Paolo Bonzini wrote: On 12/05/21 09:15, Vladimir Sementsov-Ogievskiy wrote: I don't understand.  Why doesn't aio_co_enter go through the ctx != qemu_get_current_aio_context() branch and just do aio_co_schedule? That was at least the idea behind aio_co_wake and aio_co_enter

Re: [PATCH v3 06/33] util/async: aio_co_schedule(): support reschedule in same ctx

2021-05-14 Thread Paolo Bonzini
On 14/05/21 19:27, Roman Kagan wrote: AFAICS your patch has basically the same effect as Vladimir's patch "util/async: aio_co_enter(): do aio_co_schedule in general case" (https://lore.kernel.org/qemu-devel/20210408140827.332915-4-vsement...@virtuozzo.com/). That one was found to break e.g. aio=

Re: [PATCH v3 06/33] util/async: aio_co_schedule(): support reschedule in same ctx

2021-05-14 Thread Roman Kagan
On Thu, May 13, 2021 at 11:04:37PM +0200, Paolo Bonzini wrote: > On 12/05/21 09:15, Vladimir Sementsov-Ogievskiy wrote: > > > > > > > > > > I don't understand.  Why doesn't aio_co_enter go through the ctx != > > > qemu_get_current_aio_context() branch and just do aio_co_schedule? > > > That was a

Re: [PATCH v3 06/33] util/async: aio_co_schedule(): support reschedule in same ctx

2021-05-13 Thread Paolo Bonzini
On 12/05/21 09:15, Vladimir Sementsov-Ogievskiy wrote: I don't understand.  Why doesn't aio_co_enter go through the ctx != qemu_get_current_aio_context() branch and just do aio_co_schedule? That was at least the idea behind aio_co_wake and aio_co_enter. Because ctx is exactly qemu_get_c

Re: [PATCH v3 06/33] util/async: aio_co_schedule(): support reschedule in same ctx

2021-05-12 Thread Vladimir Sementsov-Ogievskiy
12.05.2021 09:56, Paolo Bonzini wrote: On 16/04/21 10:08, Vladimir Sementsov-Ogievskiy wrote: With the following patch we want to call wake coroutine from thread. And it doesn't work with aio_co_wake: Assume we have no iothreads. Assume we have a coroutine A, which waits in the yield point for e

Re: [PATCH v3 06/33] util/async: aio_co_schedule(): support reschedule in same ctx

2021-05-11 Thread Paolo Bonzini
On 16/04/21 10:08, Vladimir Sementsov-Ogievskiy wrote: With the following patch we want to call wake coroutine from thread. And it doesn't work with aio_co_wake: Assume we have no iothreads. Assume we have a coroutine A, which waits in the yield point for external aio_co_wake(), and no progress c

Re: [PATCH v3 06/33] util/async: aio_co_schedule(): support reschedule in same ctx

2021-04-26 Thread Vladimir Sementsov-Ogievskiy
23.04.2021 13:09, Roman Kagan wrote: On Fri, Apr 16, 2021 at 11:08:44AM +0300, Vladimir Sementsov-Ogievskiy wrote: With the following patch we want to call wake coroutine from thread. And it doesn't work with aio_co_wake: Assume we have no iothreads. Assume we have a coroutine A, which waits in

Re: [PATCH v3 06/33] util/async: aio_co_schedule(): support reschedule in same ctx

2021-04-23 Thread Roman Kagan
On Fri, Apr 16, 2021 at 11:08:44AM +0300, Vladimir Sementsov-Ogievskiy wrote: > With the following patch we want to call wake coroutine from thread. > And it doesn't work with aio_co_wake: > Assume we have no iothreads. > Assume we have a coroutine A, which waits in the yield point for > external a

[PATCH v3 06/33] util/async: aio_co_schedule(): support reschedule in same ctx

2021-04-16 Thread Vladimir Sementsov-Ogievskiy
With the following patch we want to call wake coroutine from thread. And it doesn't work with aio_co_wake: Assume we have no iothreads. Assume we have a coroutine A, which waits in the yield point for external aio_co_wake(), and no progress can be done until it happen. Main thread is in blocking ai