[Top][All Lists]

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

Re: [Qemu-devel] [PATCH v2 11/11] block: Only poll block layer fds in bd

From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2 11/11] block: Only poll block layer fds in bdrv_aio_poll
Date: Wed, 29 Jul 2015 09:37:37 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1

On 29/07/2015 06:42, Fam Zheng wrote:
> @@ -2613,6 +2613,8 @@ bool bdrv_aio_poll(AioContext *ctx, bool blocking)
>  {
>      bool ret;
> +    aio_disable_clients(ctx, AIO_CLIENT_DATAPLANE | AIO_CLIENT_NBD_SERVER);
>      ret = aio_poll(ctx, blocking);
> +    aio_enable_clients(ctx, AIO_CLIENT_DATAPLANE | AIO_CLIENT_NBD_SERVER);
>      return ret;

This is not enough, because another thread's aio_poll can sneak in
between calls to bdrv_aio_poll if the AioContext lock is released, and
they will use the full set of clients.

Similar to your v1, it works with the large critical sections we
currently have, but it has the same problem in the longer term.

The clients have to be disabled around calls to bdrv_drain, as you were
doing when you had pause/resume notifiers.  Patches 1-8 however are ok.


reply via email to

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