Hi,
This series:
- Fixes some bugs/minor inconveniences,
- Removes libfuse from the request processing path,
- Make the FUSE export use coroutines for request handling,
More detail on the v1 cover letter:
https://lists.nongnu.org/archive/html/qemu-block/2025-03/msg00359.html
v2 cover letter:
https://lists.nongnu.org/archive/html/qemu-block/2025-06/msg00040.html
v3 cover letter:
https://lists.nongnu.org/archive/html/qemu-block/2025-07/msg00005.html
I noticed some performance differences vs. my previous benchmarks;
notably, performance didn’t improve with the introduction of coroutines
much (except for random read performance). However, when I run the same
benchmarks on the old branch again, I see no performance improvement
either. Something about my host system must have changed.
Changes from v3:
- Patch 1: Use QEMU_AUTO_VFREE
- Patch 6: Added (fix for pre-existing bug)
- Patch 11: Make flag atomic, better this way for multithreading later
- Patch 12: Rename not only in fuse_write(), but fuse_read() as well
- Patch 13: Added (don’t truncate if we don’t want to test that)
- Patch 14: Added (fix for pre-existing bugs)
- Patch 16: Rewrote core parts:
- Remove the macros to handle different FUSE requests in the same
buffer, instead use unions
- Restructure how we read data from FUSE:
No longer one request_buf per queue, but instead a non-WRITE buffer
on the stack, and a WRITE data buffer on the heap. We pass this via
readv(), but it means that for non-WRITE requests, data that we want
on the stack may spill into the heap buffer, so we need to copy it
back. We cache the data buffer between non-WRITE requests so we at
least don’t have to reallocate it all the time.
- Actually take care of older FUSE versions down to 7.9 (2007)
- Handle some more requests that should be handled: STATFS, DESTROY,
FORGET, BATCH_FORGET
- Don’t handle short writes on /dev/fuse
- Move initializing fuse_out_header into the callers of
fuse_write_response() and fuse_write_buf_response()
- Patch 18: Rebase conflicts because of patch 16, and removed the unused
FuseRequestCoParam
- Patch 19: Adhere to QAPI max line length
- Patch 21: Added, not sure if absolutely necessary, but won’t hurt
either
- Patch 22: Rebase conflicts because of patch 16
git-backport-diff from v3:
Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch
[down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively
001/24:[0009] [FC] 'fuse: Copy write buffer content before polling'
002/24:[----] [--] 'fuse: Ensure init clean-up even with error_fatal'
003/24:[----] [--] 'fuse: Remove superfluous empty line'
004/24:[----] [--] 'fuse: Explicitly set inode ID to 1'
005/24:[----] [--] 'fuse: Change setup_... to mount_fuse_export()'
006/24:[down] 'fuse: Destroy session on mount_fuse_export() fail'
007/24:[----] [--] 'fuse: Fix mount options'
008/24:[----] [--] 'fuse: Set direct_io and parallel_direct_writes'
009/24:[----] [--] 'fuse: Introduce fuse_{at,de}tach_handlers()'
010/24:[----] [--] 'fuse: Introduce fuse_{inc,dec}_in_flight()'
011/24:[0008] [FC] 'fuse: Add halted flag'
012/24:[0012] [FC] 'fuse: fuse_{read,write}: Rename length to blk_len'
013/24:[down] 'iotests/308: Use conv=notrunc to test growability'
014/24:[down] 'fuse: Explicitly handle non-grow post-EOF accesses'
015/24:[----] [--] 'block: Move qemu_fcntl_addfl() into osdep.c'
016/24:[0718] [FC] 'fuse: Manually process requests (without libfuse)'
017/24:[----] [-C] 'fuse: Reduce max read size'
018/24:[0102] [FC] 'fuse: Process requests in coroutines'
019/24:[0018] [FC] 'block/export: Add multi-threading interface'
020/24:[----] [--] 'iotests/307: Test multi-thread export interface'
021/24:[down] 'fuse: Make shared export state atomic'
022/24:[0084] [FC] 'fuse: Implement multi-threading'
023/24:[----] [--] 'qapi/block-export: Document FUSE's multi-threading'
024/24:[----] [--] 'iotests/308: Add multi-threading sanity test'
Hanna Czenczek (24):
fuse: Copy write buffer content before polling
fuse: Ensure init clean-up even with error_fatal
fuse: Remove superfluous empty line
fuse: Explicitly set inode ID to 1
fuse: Change setup_... to mount_fuse_export()
fuse: Destroy session on mount_fuse_export() fail
fuse: Fix mount options
fuse: Set direct_io and parallel_direct_writes
fuse: Introduce fuse_{at,de}tach_handlers()
fuse: Introduce fuse_{inc,dec}_in_flight()
fuse: Add halted flag
fuse: fuse_{read,write}: Rename length to blk_len
iotests/308: Use conv=notrunc to test growability
fuse: Explicitly handle non-grow post-EOF accesses
block: Move qemu_fcntl_addfl() into osdep.c
fuse: Manually process requests (without libfuse)
fuse: Reduce max read size
fuse: Process requests in coroutines
block/export: Add multi-threading interface
iotests/307: Test multi-thread export interface
fuse: Make shared export state atomic
fuse: Implement multi-threading
qapi/block-export: Document FUSE's multi-threading
iotests/308: Add multi-threading sanity test
qapi/block-export.json | 41 +-
include/block/export.h | 12 +-
include/qemu/osdep.h | 1 +
block/export/export.c | 48 +-
block/export/fuse.c | 1278 ++++++++++++++++++++------
block/export/vduse-blk.c | 7 +
block/export/vhost-user-blk-server.c | 8 +
block/file-posix.c | 17 +-
nbd/server.c | 6 +
util/osdep.c | 18 +
tests/qemu-iotests/307 | 47 +
tests/qemu-iotests/307.out | 18 +
tests/qemu-iotests/308 | 95 +-
tests/qemu-iotests/308.out | 71 +-
14 files changed, 1358 insertions(+), 309 deletions(-)
--
2.53.0