[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v1 04/17] block: prepare for supporting selective by
From: |
Ming Lei |
Subject: |
[Qemu-devel] [PATCH v1 04/17] block: prepare for supporting selective bypass coroutine |
Date: |
Tue, 5 Aug 2014 11:33:05 +0800 |
If device thinks that it isn't necessary to apply coroutine
in its performance sensitive path, it can call
block_set_bypass_co(false) to bypass the coroutine
and just call the function directly in the aio read/write path.
One example is virtio-blk dataplane.
Signed-off-by: Ming Lei <address@hidden>
---
block.c | 10 ++++++++++
include/block/block.h | 3 +++
include/block/block_int.h | 3 +++
3 files changed, 16 insertions(+)
diff --git a/block.c b/block.c
index 8cf519b..ac184ef 100644
--- a/block.c
+++ b/block.c
@@ -5840,3 +5840,13 @@ void bdrv_flush_io_queue(BlockDriverState *bs)
bdrv_flush_io_queue(bs->file);
}
}
+
+void bdrv_set_bypass_co(BlockDriverState *bs, bool bypass)
+{
+ bs->bypass_co = bypass;
+}
+
+bool bdrv_get_bypass_co(BlockDriverState *bs)
+{
+ return bs->bypass_co;
+}
diff --git a/include/block/block.h b/include/block/block.h
index f08471d..92f2f3a 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -588,4 +588,7 @@ void bdrv_io_plug(BlockDriverState *bs);
void bdrv_io_unplug(BlockDriverState *bs);
void bdrv_flush_io_queue(BlockDriverState *bs);
+void bdrv_set_bypass_co(BlockDriverState *bs, bool bypass);
+bool bdrv_get_bypass_co(BlockDriverState *bs);
+
#endif
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 7b541a0..9fa2f4c 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -354,6 +354,9 @@ struct BlockDriverState {
/* Whether produces zeros when read beyond eof */
bool zero_beyond_eof;
+ /* Whether bypasses coroutine when doing aio read & write */
+ bool bypass_co;
+
/* Alignment requirement for offset/length of I/O requests */
unsigned int request_alignment;
--
1.7.9.5
- [Qemu-devel] [PATCH v1 01/17] qemu/obj_pool.h: introduce object allocation pool, (continued)
[Qemu-devel] [PATCH v1 02/17] dataplane: use object pool to speed up allocation for virtio blk request, Ming Lei, 2014/08/04
[Qemu-devel] [PATCH v1 03/17] qemu coroutine: support bypass mode, Ming Lei, 2014/08/04
[Qemu-devel] [PATCH v1 04/17] block: prepare for supporting selective bypass coroutine,
Ming Lei <=
[Qemu-devel] [PATCH v1 05/17] garbage collector: introduced for support of bypass coroutine, Ming Lei, 2014/08/04
[Qemu-devel] [PATCH v1 06/17] block: introduce bdrv_co_can_bypass_co, Ming Lei, 2014/08/04
[Qemu-devel] [PATCH v1 07/17] block: support to bypass qemu coroutinue, Ming Lei, 2014/08/04
[Qemu-devel] [PATCH v1 08/17] Revert "raw-posix: drop raw_get_aio_fd() since it is no longer used", Ming Lei, 2014/08/04
[Qemu-devel] [PATCH v1 09/17] dataplane: enable selective bypassing coroutine, Ming Lei, 2014/08/04
[Qemu-devel] [PATCH v1 10/17] linux-aio: fix submit aio as a batch, Ming Lei, 2014/08/04
[Qemu-devel] [PATCH v1 11/17] linux-aio: handling -EAGAIN for !s->io_q.plugged case, Ming Lei, 2014/08/04
[Qemu-devel] [PATCH v1 12/17] linux-aio: increase max event to 256, Ming Lei, 2014/08/04
[Qemu-devel] [PATCH v1 13/17] linux-aio: remove 'node' from 'struct qemu_laiocb', Ming Lei, 2014/08/04