From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42446) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X44HV-0006Jz-2V for qemu-devel@nongnu.org; Mon, 07 Jul 2014 04:28:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X44HP-0003eo-L5 for qemu-devel@nongnu.org; Mon, 07 Jul 2014 04:28:13 -0400 Received: from mail-wg0-x22b.google.com ([2a00:1450:400c:c00::22b]:36643) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X44HP-0003ek-Dw for qemu-devel@nongnu.org; Mon, 07 Jul 2014 04:28:07 -0400 Received: by mail-wg0-f43.google.com with SMTP id b13so3926491wgh.26 for ; Mon, 07 Jul 2014 01:28:06 -0700 (PDT) Date: Mon, 7 Jul 2014 10:28:03 +0200 From: Stefan Hajnoczi Message-ID: <20140707082803.GF7963@stefanha-thinkpad.redhat.com> References: <1404406760-22981-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Il7n/DHsA0sMLmDu" Content-Disposition: inline In-Reply-To: <1404406760-22981-1-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH for-2.1?!?] AioContext: speed up aio_notify List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, ming.lei@canonical.com, qemu-devel@nongnu.org, stefanha@redhat.com --Il7n/DHsA0sMLmDu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 unnecessar= y. > 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. >=20 > 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. >=20 > 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. >=20 > Signed-off-by: Paolo Bonzini > --- > It should work, but I think this is a bit too tricky for 2.1. >=20 > 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 --Il7n/DHsA0sMLmDu Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJTuloTAAoJEJykq7OBq3PIE5oH/jHpS7yzNdBNDiapBz97DU8O DABpPwEqxBX38Co5pNNkX++jZMrufj7cWMEq4zXkfM5/fOjWtCs3uG/gBKPIyt3w bPYtiv+QCfwJefn4rqTjjkFBne8I8divDyLDXwECl9v4v5EheeJ2s3DB3KvOfN1P uArN90wjBNSmdjU9GIyAHEcRxDQt7XGA7Y6YWXLxOre53BlZKje9xw54LvgTgL6A 7+U7a1VzV8GlvlZjZBPEDtFkXayOArV8hilnXJoLN59ySyaD/T4upEFWqLMdVUMV qVXMGCxJ4xHlJ3ajHoiU6dFgnDjYCEPA+rTxiEHSmSTt6MMWpQqcviuiIzf1E3c= =gH9P -----END PGP SIGNATURE----- --Il7n/DHsA0sMLmDu--