summary refs log tree commit diff stats
path: root/include/sysemu/block-backend-io.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2023-04-07 17:33:03 +0200
committerKevin Wolf <kwolf@redhat.com>2023-04-11 16:46:49 +0200
commit81f730d4d0e8af9c0211c3fedf406df0046341a9 (patch)
treee0d6ed4cd1dd736e9e4f1e6b2ba5bea0c3617d14 /include/sysemu/block-backend-io.h
parent9ed98cae151368cc89c4bb77c9f325f7185e8f09 (diff)
downloadfocaccia-qemu-81f730d4d0e8af9c0211c3fedf406df0046341a9.tar.gz
focaccia-qemu-81f730d4d0e8af9c0211c3fedf406df0046341a9.zip
block, block-backend: write some hot coroutine wrappers by hand
The introduction of the graph lock is causing blk_get_geometry, a hot function
used in the I/O path, to create a coroutine.  However, the only part that really
needs to run in coroutine context is the call to bdrv_co_refresh_total_sectors,
which in turn only happens in the rare case of host CD-ROM devices.

So, write by hand the three wrappers on the path from blk_co_get_geometry to
bdrv_co_refresh_total_sectors, so that the coroutine wrapper is only created
if bdrv_nb_sectors actually calls bdrv_refresh_total_sectors.

Reported-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20230407153303.391121-9-pbonzini@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/sysemu/block-backend-io.h')
-rw-r--r--include/sysemu/block-backend-io.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/sysemu/block-backend-io.h b/include/sysemu/block-backend-io.h
index c672b77247..bb25493ba1 100644
--- a/include/sysemu/block-backend-io.h
+++ b/include/sysemu/block-backend-io.h
@@ -72,11 +72,10 @@ int64_t co_wrapper_mixed blk_getlength(BlockBackend *blk);
 
 void coroutine_fn blk_co_get_geometry(BlockBackend *blk,
                                       uint64_t *nb_sectors_ptr);
-void co_wrapper_mixed blk_get_geometry(BlockBackend *blk,
-                                       uint64_t *nb_sectors_ptr);
+void blk_get_geometry(BlockBackend *blk, uint64_t *nb_sectors_ptr);
 
 int64_t coroutine_fn blk_co_nb_sectors(BlockBackend *blk);
-int64_t co_wrapper_mixed blk_nb_sectors(BlockBackend *blk);
+int64_t blk_nb_sectors(BlockBackend *blk);
 
 void *blk_try_blockalign(BlockBackend *blk, size_t size);
 void *blk_blockalign(BlockBackend *blk, size_t size);