qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kwolf@redhat.com, ming.lei@canonical.com, qemu-devel@nongnu.org,
	stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH for-2.1?!?] AioContext: speed up aio_notify
Date: Mon, 7 Jul 2014 10:28:03 +0200	[thread overview]
Message-ID: <20140707082803.GF7963@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1404406760-22981-1-git-send-email-pbonzini@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1445 bytes --]

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 <pbonzini@redhat.com>
> ---
>         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 #2: Type: application/pgp-signature, Size: 473 bytes --]

      parent reply	other threads:[~2014-07-07  8:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-03 16:59 [Qemu-devel] [PATCH for-2.1?!?] AioContext: speed up aio_notify Paolo Bonzini
2014-07-03 18:17 ` Stefan Hajnoczi
2014-07-04  6:51   ` Paolo Bonzini
2014-07-04  7:23     ` Ming Lei
2014-07-04  7:27       ` Paolo Bonzini
2014-07-04 10:26         ` Kevin Wolf
2014-07-04 10:40           ` Paolo Bonzini
2014-07-07  8:28 ` Stefan Hajnoczi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140707082803.GF7963@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=ming.lei@canonical.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).