qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v2] nbd/server: attach client channel to the exp


From: John Snow
Subject: Re: [Qemu-block] [PATCH v2] nbd/server: attach client channel to the export's AioContext
Date: Fri, 20 Sep 2019 14:12:22 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0


On 9/12/19 7:00 AM, Sergio Lopez wrote:
> On creation, the export's AioContext is set to the same one as the
> BlockBackend, while the AioContext in the client QIOChannel is left
> untouched.
> 
> As a result, when using data-plane, nbd_client_receive_next_request()
> schedules coroutines in the IOThread AioContext, while the client's
> QIOChannel is serviced from the main_loop, potentially triggering the
> assertion at qio_channel_restart_[read|write].
> 
> To fix this, as soon we have the export corresponding to the client,
> we call qio_channel_attach_aio_context() to attach the QIOChannel
> context to the export's AioContext. This matches with the logic at
> blk_aio_attached().
> 
> RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1748253
> Signed-off-by: Sergio Lopez <address@hidden>
> ---
> Changelog
> 
> v2:
>  - Attach the channel once after negotiation completes, avoiding
>    duplication. (thanks Kevin Wolf).
> ---
>  nbd/server.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/nbd/server.c b/nbd/server.c
> index 28c3c8be85..31d624e146 100644
> --- a/nbd/server.c
> +++ b/nbd/server.c
> @@ -1297,6 +1297,11 @@ static coroutine_fn int nbd_negotiate(NBDClient 
> *client, Error **errp)
>          return ret;
>      }
>  
> +    /* Attach the channel to the same AioContext as the export */
> +    if (client->exp && client->exp->ctx) {
> +        qio_channel_attach_aio_context(client->ioc, client->exp->ctx);
> +    }
> +
>      assert(!client->optlen);
>      trace_nbd_negotiate_success();
>  
> 

I assume this patch has been superseded by Eric's later patches?

--js



reply via email to

[Prev in Thread] Current Thread [Next in Thread]