qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH for-2.1?!?] AioContext: speed up aio_notify


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH for-2.1?!?] AioContext: speed up aio_notify
Date: Mon, 7 Jul 2014 10:28:03 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

On Thu, Jul 03, 2014 at 06:59:20PM +0200, Paolo Bonzini wrote:
> In many cases, the call to event_notifier_set in aio_notify is unnecessary.
> In particular, if we are executing aio_dispatch, or if aio_poll is not
> blocking, we know that we will soon get to the next loop iteration (if
> necessary); the thread that hosts the AioContext's event loop does not
> need any nudging.
> 
> The patch includes a Promela formal model that shows that this really
> works and does not need any further complication such as generation
> counts.  It needs a memory barrier though.
> 
> The generation counts are not needed because we only care of the state
> of ctx->dispatching at the time the memory barrier happens.  If
> ctx->dispatching is one at the time the memory barrier happens,
> the aio_notify is not needed even if it afterwards becomes zero.
> 
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
>         It should work, but I think this is a bit too tricky for 2.1.
> 
>  aio-posix.c             |  34 +++++++++++++++-
>  async.c                 |  13 +++++-
>  docs/aio_notify.promela | 104 
> ++++++++++++++++++++++++++++++++++++++++++++++++
>  include/block/aio.h     |   9 +++++
>  4 files changed, 158 insertions(+), 2 deletions(-)
>  create mode 100644 docs/aio_notify.promela

I can test rbd and gluster.

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan

Attachment: pgpcvXpoISecS.pgp
Description: PGP signature


reply via email to

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