qemu-e2k/include
Paolo Bonzini 4951967d84 ratelimit: protect with a mutex
Right now, rate limiting is protected by the AioContext mutex, which is
taken for example both by the block jobs and by qmp_block_job_set_speed
(via find_block_job).

We would like to remove the dependency of block layer code on the
AioContext mutex, since most drivers and the core I/O code are already
not relying on it.  However, there is no existing lock that can easily
be taken by both ratelimit_set_speed and ratelimit_calculate_delay,
especially because the latter might run in coroutine context (and
therefore under a CoMutex) but the former will not.

Since concurrent calls to ratelimit_calculate_delay are not possible,
one idea could be to use a seqlock to get a snapshot of slice_ns and
slice_quota.  But for now keep it simple, and just add a mutex to the
RateLimit struct; block jobs are generally not performance critical to
the point of optimizing the clock cycles spent in synchronization.

This also requires the introduction of init/destroy functions, so
add them to the two users of ratelimit.h.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-05-04 14:15:35 +02:00
..
authz
block block: Add BDRV_O_NO_SHARE for blk_new_open() 2021-04-30 12:27:48 +02:00
chardev
crypto
disas
exec exec: Remove accel/tcg/ from include paths 2021-05-01 11:44:13 -07:00
fpu
hw hw/pci-host/gpex: Don't fault for unmapped parts of MMIO and PIO windows 2021-04-30 11:16:52 +01:00
io
libdecnumber
migration migration: Inhibit virtio-balloon for the duration of background snapshot 2021-04-06 18:56:01 +01:00
monitor
net net: check the existence of peer before trying to pad 2021-04-23 11:11:28 +01:00
qapi Revert "hmp: Use QAPI NetdevInfo in hmp_info_network" 2021-04-08 17:33:59 +08:00
qemu ratelimit: protect with a mutex 2021-05-04 14:15:35 +02:00
qom
scsi
semihosting
standard-headers
sysemu Add NVMM accelerator: acceleration enlightenments 2021-05-04 14:15:34 +02:00
tcg
ui
user
elf.h
glib-compat.h
qemu-common.h
qemu-io.h
trace-tcg.h