Skip to content

export/fuse: Use coroutines and multi-threading

Hanna Czenczek qemu-devel 5 versions – Applied

Status from this message: Thanks, applied to the block branch.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest25 patches 1 replyApplied
  2. v424 patches 4 repliesSuperseded
  3. v321 patches 23 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v221 patches18 repliesSuperseded
v115 patches43 repliesSuperseded

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/25fuse: Copy write buffer content before pollingblock/export/fuse.c+16 -10 replies
2/25fuse: Ensure init clean-up even with error_fatalblock/export/fuse.c+1 -00 replies
3/25fuse: Remove superfluous empty lineblock/export/fuse.c+0 -10 replies
4/25fuse: Explicitly set inode ID to 1block/export/fuse.c+1 -10 replies
5/25fuse: Change setup_... to mount_fuse_export()block/export/fuse.c+22 -270 replies
6/25fuse: Destroy session on mount_fuse_export() failblock/export/fuse.c+7 -10 replies
7/25fuse: Fix mount optionsblock/export/fuse.c tests/qemu-iotests/308 tests/qemu-iotests/308.out +2 more+23 -100 replies
8/25fuse: Set direct_io and parallel_direct_writesblock/export/fuse.c tests/qemu-iotests/308.out+3 -10 replies
9/25fuse: Introduce fuse_{at,de}tach_handlers()block/export/fuse.c+16 -160 replies
10/25fuse: Introduce fuse_{inc,dec}_in_flight()block/export/fuse.c+21 -80 replies
11/25fuse: Add halted flagblock/export/fuse.c+30 -00 replies
12/25fuse: fuse_{read,write}: Rename length to blk_lenblock/export/fuse.c+12 -120 replies
13/25iotests/308: Use conv=notrunc to test growabilitytests/qemu-iotests/308+3 -20 replies
14/25fuse: Explicitly handle non-grow post-EOF accessesblock/export/fuse.c tests/qemu-iotests/308 tests/qemu-iotests/308.out+59 -60 replies
15/25block: Move qemu_fcntl_addfl() into osdep.cblock/file-posix.c include/qemu/osdep.h util/osdep.c+20 -160 replies
16/25fuse: Drop permission changes in fuse_do_truncateblock/export/fuse.c+2 -320 replies
17/25fuse: Manually process requests (without libfuse)block/export/fuse.c+721 -2240 replies
18/25fuse: Reduce max read sizeblock/export/fuse.c+1 -10 replies
19/25fuse: Process requests in coroutinesblock/export/fuse.c+104 -720 replies
20/25block/export: Add multi-threading interfaceblock/export/export.c block/export/fuse.c block/export/vduse-blk.c +4 more+113 -110 replies
21/25iotests/307: Test multi-thread export interfacetests/qemu-iotests/307 tests/qemu-iotests/307.out+65 -00 replies
22/25fuse: Make shared export state atomicblock/export/fuse.c+13 -100 replies
23/25fuse: Implement multi-threadingblock/export/fuse.c+153 -400 replies
24/25qapi/block-export: Document FUSE's multi-threadingqapi/block-export.json+5 -00 replies
25/25iotests/308: Add multi-threading sanity testtests/qemu-iotests/308 tests/qemu-iotests/308.out+107 -00 replies

Reviews trailers per patch

13 of 25 patches have a Reviewed-by or Acked-by.

PatchStefan HajnocziKevin WolfMarkus Armbruster
1/25R-b
2/25R-b
3/25R-b
4/25R-b
5/25R-b
6/25
7/25R-b
8/25R-b
9/25R-b
10/25R-b
11/25
12/25
13/25
14/25
15/25
16/25
17/25
18/25R-b
19/25
20/25R-b A-b
21/25
22/25
23/25
24/25A-b
25/25R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v5 thread

Cover letter [PATCH v5 00/25] export/fuse: Use coroutines and multi-threading

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

v4 cover letter:
https://lists.nongnu.org/archive/html/qemu-block/2026-02/msg00324.html

v4 fixes the problems Kevin has pointed out on list:
- Fix fuse-allow-other test by making the export writable,
- Drop outdated comment,
- Add comment explaining why bufptr should be explicitly set to NULL in the empty-read branch of fuse_read().

And the TSA warnings indicated off-list, by making all FUSE handling functions (which run in a coroutine) GRAPH_RDLOCK, having fuse_co_process_request() take the lock. For this, we need to drop the permission manipulation functions in the I/O path, but that is easy (new patch 16).

git-backport-diff from v4:

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/25:[----] [--] 'fuse: Copy write buffer content before polling' 002/25:[----] [--] 'fuse: Ensure init clean-up even with error_fatal' 003/25:[----] [--] 'fuse: Remove superfluous empty line' 004/25:[----] [--] 'fuse: Explicitly set inode ID to 1' 005/25:[----] [--] 'fuse: Change setup_... to mount_fuse_export()' 006/25:[----] [--] 'fuse: Destroy session on mount_fuse_export() fail' 007/25:[0012] [FC] 'fuse: Fix mount options'
008/25:[----] [--] 'fuse: Set direct_io and parallel_direct_writes' 009/25:[----] [--] 'fuse: Introduce fuse_{at,de}tach_handlers()' 010/25:[----] [--] 'fuse: Introduce fuse_{inc,dec}_in_flight()' 011/25:[----] [--] 'fuse: Add halted flag'
012/25:[----] [--] 'fuse: fuse_{read,write}: Rename length to blk_len' 013/25:[----] [--] 'iotests/308: Use conv=notrunc to test growability' 014/25:[----] [--] 'fuse: Explicitly handle non-grow post-EOF accesses' 015/25:[----] [--] 'block: Move qemu_fcntl_addfl() into osdep.c' 016/25:[down] 'fuse: Drop permission changes in fuse_do_truncate' 017/25:[0003] [FC] 'fuse: Manually process requests (without libfuse)' 018/25:[----] [-C] 'fuse: Reduce max read size' 019/25:[0034] [FC] 'fuse: Process requests in coroutines' 020/25:[----] [--] 'block/export: Add multi-threading interface' 021/25:[----] [--] 'iotests/307: Test multi-thread export interface' 022/25:[----] [--] 'fuse: Make shared export state atomic' 023/25:[----] [--] 'fuse: Implement multi-threading' 024/25:[----] [--] 'qapi/block-export: Document FUSE's multi-threading' 025/25:[----] [--] 'iotests/308: Add multi-threading sanity test'

Hanna Czenczek (25):
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: Drop permission changes in fuse_do_truncate
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                           | 1311 +++++++++++++----
 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 +-
 tests/qemu-iotests/tests/fuse-allow-other     |    3 +-
 tests/qemu-iotests/tests/fuse-allow-other.out |    9 +-
 16 files changed, 1369 insertions(+), 343 deletions(-)
Signature · 1 line
2.53.0