From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycwly-0003uJ-3j for qemu-devel@nongnu.org; Tue, 31 Mar 2015 10:04:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ycwlq-0003fI-1J for qemu-devel@nongnu.org; Tue, 31 Mar 2015 10:04:06 -0400 Received: from mail-wg0-x22a.google.com ([2a00:1450:400c:c00::22a]:35064) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycwlp-0003em-Rp for qemu-devel@nongnu.org; Tue, 31 Mar 2015 10:03:57 -0400 Received: by wgdm6 with SMTP id m6so20426971wgd.2 for ; Tue, 31 Mar 2015 07:03:57 -0700 (PDT) Date: Tue, 31 Mar 2015 15:03:53 +0100 From: Stefan Hajnoczi Message-ID: <20150331140353.GA27156@stefanha-thinkpad.redhat.com> References: <1424449612-18215-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VbJkn9YxBvnuCH5J" Content-Disposition: inline In-Reply-To: <1424449612-18215-1-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH RFC 0/3] iothread: release iothread around aio_poll List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: famz@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com --VbJkn9YxBvnuCH5J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 20, 2015 at 05:26:49PM +0100, Paolo Bonzini wrote: > Right now, iothreads are relying on a "contention callback" to release > the AioContext (e.g. for block device operations or to do bdrv_drain_all). > This is necessary because aio_poll needs to be called within an > aio_context_acquire. >=20 > This series drops this requirement for aio_poll, with two effects: >=20 > 1) it makes it possible to remove the "contention callback" in RFifoLock > (and possibly to convert it to a normal GRecMutex, which is why I am not > including a patch to remove callbacks from RFifoLock). >=20 > 2) it makes it possible to start work around making critical sections > for the block layer fine-grained. >=20 > In order to do this, some data is moved from AioContext to local storage. > Stack allocation has size limitations, so thread-local storage is used > instead. There are no reentrancy problems because the data is only live > throughout a small part of aio_poll, and in particular not during the > invocation of callbacks. >=20 > Comments? >=20 > Paolo >=20 > Paolo Bonzini (3): > aio-posix: move pollfds to thread-local storage > AioContext: acquire/release AioContext during aio_poll > iothread: release iothread around aio_poll >=20 > aio-posix.c | 86 ++++++++++++++++++++++++++++++++++++++++-------= ------ > aio-win32.c | 8 +++++ > async.c | 10 +------ > include/block/aio.h | 18 +++++------ > iothread.c | 11 ++----- > tests/test-aio.c | 21 +++++++------ > 6 files changed, 96 insertions(+), 58 deletions(-) Thanks, applied to my block-next tree: https://github.com/stefanha/qemu/commits/block-next Stefan --VbJkn9YxBvnuCH5J Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVGqlJAAoJEJykq7OBq3PIAaAH/ik25zQSeVShVCvivyVvj2xt UszbjOPr973Vnr9hc5wFtBhWTC0qKDYFs8SJyjNbWHA9DZ00Akl0W1kN0Zf7Hewh 35uHbwBAsfPVH4OR8hpRUMphY1+Rc1TwBSetahkb6eHEU5dYBnZrWZjpBxyFJrWz GW7iY0N3nYrYVCLASAmRVXJ3hMiQVh5PuT/Y2m962sJKsO2X0IAsQmhYfeBbuMRI gNkKWcuf6yyz2RFTXYIhxCe60rD01fkkqRdbM5mPKo/86zqFIl8onikASYtCX2ay Q54x6eSI2Pn8YEnMVRBYcXtlq5kCEisJVlAmM3OK2nb8xhWeVk8reTLZmJ/wTTA= =Rvu+ -----END PGP SIGNATURE----- --VbJkn9YxBvnuCH5J--