[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 06/19] block: replace g_new0 with g_new for bottom ha
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 06/19] block: replace g_new0 with g_new for bottom half allocation. |
Date: |
Fri, 19 Dec 2014 17:34:56 +0100 |
From: Paolo Bonzini <address@hidden>
This saves about 15% of the clock cycles spent on allocation. Using the
slice allocator does not add a visible improvement; allocation is faster
than malloc, while freeing seems to be slower.
Signed-off-by: Paolo Bonzini <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
async.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/async.c b/async.c
index 572f239..2be88cc 100644
--- a/async.c
+++ b/async.c
@@ -44,10 +44,12 @@ struct QEMUBH {
QEMUBH *aio_bh_new(AioContext *ctx, QEMUBHFunc *cb, void *opaque)
{
QEMUBH *bh;
- bh = g_new0(QEMUBH, 1);
- bh->ctx = ctx;
- bh->cb = cb;
- bh->opaque = opaque;
+ bh = g_new(QEMUBH, 1);
+ *bh = (QEMUBH){
+ .ctx = ctx,
+ .cb = cb,
+ .opaque = opaque,
+ };
qemu_mutex_lock(&ctx->bh_lock);
bh->next = ctx->first_bh;
/* Make sure that the members are ready before putting bh into list */
--
1.8.3.1
- [Qemu-devel] [PULL 15/19] linux-aio: queue requests that cannot be submitted, (continued)
- [Qemu-devel] [PULL 15/19] linux-aio: queue requests that cannot be submitted, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 16/19] linux-aio: track whether the queue is blocked, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 17/19] linux-aio: rename LaioQueue idx field to "n", Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 18/19] linux-aio: drop return code from laio_io_unplug and ioq_submit, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 19/19] linux-aio: simplify removal of completed iocbs from the list, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 12/19] qemu-iotests: Remove traling whitespaces in *.out, Stefan Hajnoczi, 2014/12/12
- Re: [Qemu-devel] [PULL 00/19] Block patches, Peter Maydell, 2014/12/15
- [Qemu-devel] [PULL 00/19] Block patches, Kevin Wolf, 2014/12/19
- [Qemu-devel] [PULL 02/19] qemu-iotests: Speed up make check-block, Kevin Wolf, 2014/12/19
- [Qemu-devel] [PULL 05/19] block: do not allocate an iovec per read of a growable/zero_after_eof BDS, Kevin Wolf, 2014/12/19
- [Qemu-devel] [PULL 06/19] block: replace g_new0 with g_new for bottom half allocation.,
Kevin Wolf <=
- [Qemu-devel] [PULL 01/19] qemu-iotests: Remove 091 from quick group, Kevin Wolf, 2014/12/19
- [Qemu-devel] [PULL 07/19] checkpatch: Brace handling on multi-line condition, Kevin Wolf, 2014/12/19
- [Qemu-devel] [PULL 04/19] block: mark AioContext as recursive, Kevin Wolf, 2014/12/19
- [Qemu-devel] [PULL 12/19] iotests: Add test for relative backing file names, Kevin Wolf, 2014/12/19
- [Qemu-devel] [PULL 03/19] tests/Makefile: Add check-block to make check, Kevin Wolf, 2014/12/19
- [Qemu-devel] [PULL 11/19] block/vmdk: Relative backing file for creation, Kevin Wolf, 2014/12/19
- [Qemu-devel] [PULL 08/19] block: Get full backing filename from string, Kevin Wolf, 2014/12/19
- [Qemu-devel] [PULL 14/19] block: fix spoiling all dirty bitmaps by mirror and migration, Kevin Wolf, 2014/12/19
- [Qemu-devel] [PULL 10/19] block: Relative backing file for image creation, Kevin Wolf, 2014/12/19
- [Qemu-devel] [PULL 09/19] block: JSON filenames and relative backing files, Kevin Wolf, 2014/12/19