mirror_qemu/include
Stefan Hajnoczi e8b6535533 block: add BDRV_REQ_REGISTERED_BUF request flag
Block drivers may optimize I/O requests accessing buffers previously
registered with bdrv_register_buf(). Checking whether all elements of a
request's QEMUIOVector are within previously registered buffers is
expensive, so we need a hint from the user to avoid costly checks.

Add a BDRV_REQ_REGISTERED_BUF request flag to indicate that all
QEMUIOVector elements in an I/O request are known to be within
previously registered buffers.

Always pass the flag through to driver read/write functions. There is
little harm in passing the flag to a driver that does not use it.
Passing the flag to drivers avoids changes across many block drivers.
Filter drivers would need to explicitly support the flag and pass
through to their children when the children support it. That's a lot of
code changes and it's hard to remember to do that everywhere, leading to
silent reduced performance when the flag is accidentally dropped.

The only problematic scenario with the approach in this patch is when a
driver passes the flag through to internal I/O requests that don't use
the same I/O buffer. In that case the hint may be set when it should
actually be clear. This is a rare case though so the risk is low.

Some drivers have assert(!flags), which no longer works when
BDRV_REQ_REGISTERED_BUF is passed in. These assertions aren't very
useful anyway since the functions are called almost exclusively by
bdrv_driver_preadv/pwritev() so if we get flags handling right there
then the assertion is not needed.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20221013185908.1297568-7-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2022-10-26 14:56:42 -04:00
..
authz Prefer 'on' | 'off' over 'yes' | 'no' for bool options 2021-01-29 17:07:53 +00:00
block block: add BDRV_REQ_REGISTERED_BUF request flag 2022-10-26 14:56:42 -04:00
chardev chardev: src buffer const for write functions 2022-09-29 14:38:05 +04:00
crypto crypto: Make block callbacks return 0 on success 2022-07-12 12:14:55 +02:00
disas target/loongarch: Add disassembler 2022-06-06 18:09:03 +00:00
exec accel/tcg: Introduce TARGET_TB_PCREL 2022-10-04 12:13:16 -07:00
fpu fpu: Add rebias bool, value and operation 2022-08-31 14:08:05 -03:00
hw treewide: Remove the unnecessary space before semicolon 2022-10-24 13:41:10 +02:00
io io/command: implement support for win32 2022-10-12 19:22:01 +04:00
libdecnumber Replace config-time define HOST_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00
migration migration: Remove load_state_old and minimum_version_id_old 2022-03-02 18:20:45 +00:00
monitor hmp: add virtio commands 2022-10-09 16:38:45 -04:00
net vhost_net: add NetClientState->load() callback 2022-09-02 10:22:39 +08:00
qapi include: move qdict_{crumple,flatten} declarations 2022-04-21 17:03:51 +04:00
qemu coroutine: add flag to re-queue at front of CoQueue 2022-10-26 14:56:42 -04:00
qom qom/object: Remove circular include dependency 2022-06-28 10:53:32 +02:00
scsi scsi-disk: add SCSI_DISK_QUIRK_MODE_PAGE_VENDOR_SPECIFIC_APPLE quirk for Macintosh 2022-07-13 16:58:58 +02:00
semihosting semihosting: Allow optional use of semihosting from userspace 2022-09-13 17:18:21 +01:00
standard-headers m68k: rework BI_VIRT_RNG_SEED as BI_RNG_SEED 2022-10-21 20:46:10 +02:00
sysemu block: pass size to bdrv_unregister_buf() 2022-10-26 14:56:42 -04:00
tcg accel/tcg: Introduce tb_pc and log_pc 2022-10-04 12:13:12 -07:00
ui ui/console: Get tab completion working again in the SDL monitor vc 2022-09-23 13:42:09 +02:00
user misc: fix commonly doubled up words 2022-08-01 11:58:02 +02:00
elf.h linux-user: Honor PT_GNU_STACK 2022-09-06 08:04:25 +01:00
glib-compat.h compiler.h: replace QEMU_NORETURN with G_NORETURN 2022-04-21 17:03:51 +04:00
qemu-io.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
qemu-main.h ui/cocoa: Run qemu_init in the main thread 2022-09-23 14:36:33 +02:00