[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 28/62] block: bump coroutine pool size for drives
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 28/62] block: bump coroutine pool size for drives |
Date: |
Fri, 8 Aug 2014 19:39:29 +0200 |
From: Stefan Hajnoczi <address@hidden>
When a BlockDriverState is associated with a storage controller
DeviceState we expect guest I/O. Use this opportunity to bump the
coroutine pool size by 64.
This patch ensures that the coroutine pool size scales with the number
of drives attached to the guest. It should increase coroutine pool
usage (which makes qemu_coroutine_create() fast) without hogging too
much memory when fewer drives are attached.
Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
block.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/block.c b/block.c
index ea14981..13a1059 100644
--- a/block.c
+++ b/block.c
@@ -57,6 +57,8 @@ struct BdrvDirtyBitmap {
#define NOT_DONE 0x7fffffff /* used while emulated sync operation in progress
*/
+#define COROUTINE_POOL_RESERVATION 64 /* number of coroutines to reserve */
+
static void bdrv_dev_change_media_cb(BlockDriverState *bs, bool load);
static BlockDriverAIOCB *bdrv_aio_readv_em(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
@@ -2114,6 +2116,9 @@ int bdrv_attach_dev(BlockDriverState *bs, void *dev)
}
bs->dev = dev;
bdrv_iostatus_reset(bs);
+
+ /* We're expecting I/O from the device so bump up coroutine pool size */
+ qemu_coroutine_adjust_pool_size(COROUTINE_POOL_RESERVATION);
return 0;
}
@@ -2133,6 +2138,7 @@ void bdrv_detach_dev(BlockDriverState *bs, void *dev)
bs->dev_ops = NULL;
bs->dev_opaque = NULL;
bs->guest_block_size = 512;
+ qemu_coroutine_adjust_pool_size(-COROUTINE_POOL_RESERVATION);
}
/* TODO change to return DeviceState * when all users are qdevified */
--
1.8.3.1
- [Qemu-devel] [PULL 17/62] qmp: hide "hotplugged" device property from device-list-properties, (continued)
- [Qemu-devel] [PULL 17/62] qmp: hide "hotplugged" device property from device-list-properties, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 19/62] qemu-iotests: Add data pattern in version3 VMDK sample image in 059, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 21/62] qemu-img info: show nocow info, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 20/62] vmdk: Optimize cluster allocation, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 24/62] block/archipelago: Add support for creating images, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 23/62] block/archipelago: Implement bdrv_parse_filename(), Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 25/62] QMP: Add support for Archipelago, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 22/62] block: Support Archipelago as a QEMU block backend, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 26/62] qemu-iotests: add support for Archipelago protocol, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 27/62] coroutine: make pool size dynamic, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 28/62] block: bump coroutine pool size for drives,
Kevin Wolf <=
- [Qemu-devel] [PULL 29/62] thread-pool: avoid per-thread-pool EventNotifier, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 30/62] thread-pool: avoid deadlock in nested aio_poll() calls, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 31/62] block: vhdx - add error check, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 32/62] block: VHDX endian fixes, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 33/62] test-coroutine: add baseline test that times the cost of function calls, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 34/62] block: allow bdrv_unref() to be passed NULL pointers, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 36/62] block: use the standard 'ret' instead of 'result', Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 39/62] block: Introduce qemu_try_blockalign(), Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 37/62] block: vpc - use block layer ops in vpc_create, instead of posix calls, Kevin Wolf, 2014/08/08
- [Qemu-devel] [PULL 35/62] block: vdi - use block layer ops in vdi_create, instead of posix calls, Kevin Wolf, 2014/08/08