From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXrLv-0000FB-SJ for qemu-devel@nongnu.org; Mon, 12 Nov 2012 05:34:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXrLs-0003OF-Q3 for qemu-devel@nongnu.org; Mon, 12 Nov 2012 05:34:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56217) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXrLs-0003OB-HD for qemu-devel@nongnu.org; Mon, 12 Nov 2012 05:34:48 -0500 Message-ID: <50A0D0C4.9030300@redhat.com> Date: Mon, 12 Nov 2012 11:34:44 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <1351697677-31598-1-git-send-email-stefanha@redhat.com> In-Reply-To: <1351697677-31598-1-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 0/3] aio: use g_slice_alloc() for AIOCB pooling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Paolo Bonzini , Anthony Liguori , qemu-devel@nongnu.org Am 31.10.2012 16:34, schrieb Stefan Hajnoczi: > AIO control blocks are frequently acquired and released because each aio > request involves at least one AIOCB. Therefore, we pool them to avoid heap > allocation overhead. > > The problem with the freelist approach in AIOPool is thread-safety. If > we want BlockDriverStates to associate with AioContexts that execute in > multiple threads, then a global freelist becomes a problem. > > This patch drops the freelist and instead uses g_slice_alloc() which is > tuned for per-thread fixed-size object pools. qemu_aio_get() and > qemu_aio_release() are now thread-safe. > > Note that the change from g_malloc0() to g_slice_alloc() should be safe > since the freelist reuse case doesn't zero the AIOCB either. > > v2: > * Split into 3 patches (I still took the liberty of combining the AIOPool -> > AIOCBInfo rename with constification because I didn't want to touch all > those files twice) [Paolo] > > Stefan Hajnoczi (3): > aio: switch aiocb_size type int -> size_t > aio: use g_slice_alloc() for AIOCB pooling > aio: rename AIOPool to AIOCBInfo > > block.c | 31 ++++++++++++------------------- > block/blkdebug.c | 4 ++-- > block/blkverify.c | 4 ++-- > block/curl.c | 4 ++-- > block/gluster.c | 6 +++--- > block/iscsi.c | 12 ++++++------ > block/linux-aio.c | 4 ++-- > block/qed.c | 4 ++-- > block/rbd.c | 4 ++-- > block/sheepdog.c | 4 ++-- > block/win32-aio.c | 4 ++-- > dma-helpers.c | 4 ++-- > hw/ide/core.c | 4 ++-- > qemu-aio.h | 12 +++++------- > thread-pool.c | 4 ++-- > 15 files changed, 48 insertions(+), 57 deletions(-) Thanks, applied all to the block branch. Kevin