Re: [PATCH v2 1/1] nbd/server: do not poll within a coroutine context

2024-04-02 Thread Zhu Yangyang via
On Mon, 1 Apr 2024 11:33:09AM -0500, Eric Blake wrote: > On Mon, Apr 01, 2024 at 08:41:20PM +0800, Zhu Yangyang wrote: > > Coroutines are not supposed to block. Instead, they should yield. > > > > Fixes: f95910f ("nbd: implement TLS support in the protocol negotiation") > > Signed-off-by: Zhu Yang

[PATCH v2 1/1] nbd/server: do not poll within a coroutine context

2024-04-01 Thread Zhu Yangyang via
Coroutines are not supposed to block. Instead, they should yield. Fixes: f95910f ("nbd: implement TLS support in the protocol negotiation") Signed-off-by: Zhu Yangyang --- nbd/client.c | 7 --- nbd/common.c | 19 --- nbd/nbd-internal.h | 6 +++--- nbd/server.c

[PATCH v2 0/1] coroutine: avoid inserting duplicate coroutine to co_queue_wakeup

2024-04-01 Thread Zhu Yangyang via
The problem that inserting duplicate coroutine to co_queue_wakeu has been resolved by 7c1f51bf38 ("nbd/server: Fix drained_poll to wake coroutine in right AioContext") that avoids repeatedly waking up the same coroutine. The key modifications are as follows: static void qio_channel_restart_read(v

Re: [PATCH v1] coroutine: avoid inserting duplicate coroutine to co_queue_wakeup

2024-04-01 Thread Zhu Yangyang via
On Thu, 28 Mar 2024 07:40:14 -0500, Eric Blake wrote: > On Mon, Mar 25, 2024 at 05:18:50PM +0800, zhuyangyang via wrote: > > If g_main_loop_run()/aio_poll() is called in the coroutine context, > > the pending coroutine may be woken up repeatedly, and the co_queue_wakeup > > may be disordered. > >

Re: [PATCH v1] coroutine: avoid inserting duplicate coroutine to co_queue_wakeup

2024-03-29 Thread Zhu Yangyang via
On Thu, 28 Mar 2024 07:40:14 -0500, Eric Blake wrote: > On Mon, Mar 25, 2024 at 05:18:50PM +0800, zhuyangyang via wrote: > > If g_main_loop_run()/aio_poll() is called in the coroutine context, > > the pending coroutine may be woken up repeatedly, and the co_queue_wakeup > > may be disordered. > >