Re: [PATCH 2/4] block: make bdrv_co_parent_cb_resize() a proper IO API function

2025-07-01 Thread Hanna Czenczek
lude/block/block_int-io.h | 6 ++ 2 files changed, 9 insertions(+), 6 deletions(-) Reviewed-by: Hanna Czenczek

Re: [PATCH 4/4] iotests: add test for resizing a node below filters

2025-07-01 Thread Hanna Czenczek
-filter create mode 100644 tests/qemu-iotests/tests/resize-below-filter.out Reviewed-by: Hanna Czenczek

Re: [PATCH 1/4] include/block/block_int-common: document when resize callback is used

2025-07-01 Thread Hanna Czenczek
+ 1 file changed, 3 insertions(+) Reviewed-by: Hanna Czenczek

Re: [PATCH 3/4] block: implement 'resize' callback for child_of_bds class

2025-07-01 Thread Hanna Czenczek
drivers don’t implement bdrv_co_getlength(), so bdrv_co_refresh_total_sectors() will not change anything.  Is that right and intended? Reviewed-by: Hanna Czenczek (Babbling below.) diff --git a/block.c b/block.c index bfd4340b24..449f814ebe 100644 --- a/block.c +++ b/block.c @@ -1497,6 +1497,17

[PATCH v3 17/21] iotests/307: Test multi-thread export interface

2025-07-01 Thread Hanna Czenczek
Test the QAPI interface for multi-threaded exports. None of our exports currently support multi-threading, so it's always an error in the end, but we can still test the specific errors. Signed-off-by: Hanna Czenczek --- tests/qemu-iotests/307

Re: [PATCH] block: include 'file' child node name in block device info

2025-07-01 Thread Hanna Czenczek
On 30.06.25 16:06, Fiona Ebner wrote: In combination with using a throttle filter to enforce IO limits for a guest device, knowing the 'file' child of a block device can be useful. If the throttle filter is only intended for guest IO, block jobs should not also be limited by the throttle filter,

[PATCH v3 13/21] fuse: Manually process requests (without libfuse)

2025-07-01 Thread Hanna Czenczek
ts in parallel.) In any case, once we use coroutines throughout the code, performance will improve again across the board. Reviewed-by: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 754 +++- 1 file changed, 535 insertions(+), 21

[PATCH v3 12/21] block: Move qemu_fcntl_addfl() into osdep.c

2025-07-01 Thread Hanna Czenczek
Move file-posix's helper to add a flag (or a set of flags) to an FD's existing set of flags into osdep.c for other places to use. Suggested-by: Eric Blake Signed-off-by: Hanna Czenczek --- include/qemu/osdep.h | 1 + block/file-posix.c | 17 + util/osdep.c

[PATCH v3 00/21] export/fuse: Use coroutines and multi-threading

2025-07-01 Thread Hanna Czenczek
rt: Add multi-threading interface' 017/21:[] [--] 'iotests/307: Test multi-thread export interface' 018/21:[0016] [FC] 'fuse: Implement multi-threading' 019/21:[] [--] 'qapi/block-export: Document FUSE's multi-threading' 020/21:[] [--] 'iotests/3

[PATCH v3 19/21] qapi/block-export: Document FUSE's multi-threading

2025-07-01 Thread Hanna Czenczek
nting that is left for once that is done. Suggested-by: Stefan Hajnoczi Acked-by: Markus Armbruster Signed-off-by: Hanna Czenczek --- qapi/block-export.json | 5 + 1 file changed, 5 insertions(+) diff --git a/qapi/block-export.json b/qapi/block-export.json index ee30606680..9ae703ad01 100644

[PATCH v3 14/21] fuse: Reduce max read size

2025-07-01 Thread Hanna Czenczek
. (Larger requests are split automatically by the FUSE kernel driver anyway.) (Yes, we inadvertently already had parallel request processing due to nested polling before. Better to fix this late than never.) Reviewed-by: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 2

[PATCH v3 04/21] fuse: Explicitly set inode ID to 1

2025-07-01 Thread Hanna Czenczek
Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/export/fuse.c b/block/export/fuse.c index a93316e1f4..60d68d8fdd 100644 --- a/block/export/fuse.c +++ b/block/export/fuse.c @@ -432,7 +432,7 @@ static void fuse_getattr

[PATCH v3 15/21] fuse: Process requests in coroutines

2025-07-01 Thread Hanna Czenczek
: 141.1k ±2.9k (+ 66 % / + 11 %) So for non-AIO cases (and the null driver, which does not yield), there is little change; but for file AIO, results greatly improve, resolving the performance issue we saw before (when switching away from libfuse). Reviewed-by: Stefan Hajnoczi Signed-off-by: Hanna

[PATCH v3 21/21] fuse: Increase MAX_WRITE_SIZE with a second buffer

2025-07-01 Thread Hanna Czenczek
ng a 4G image (with qemu-img convert) to a FUSE export: - Before this patch: Takes 25.6 s (14.4 s with -t none) - After this patch: Takes 4.5 s (5.5 s with -t none) Reviewed-by: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 137 +

[PATCH v3 06/21] fuse: Fix mount options

2025-07-01 Thread Hanna Czenczek
- user_id/group_id: Mounter's UID/GID [1] It invokes fusermount3, an SUID libfuse helper program, which parses and processes some mount options before actually invoking the mount() system call. Reviewed-by: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- block/export/fus

[PATCH v3 10/21] fuse: Add halted flag

2025-07-01 Thread Hanna Czenczek
quest processing. We plan to only use this flag in cases that would effectively be kernel bugs. (Right now, the flag is unused because libfuse still does our request processing.) Reviewed-by: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- block/export/fuse.c

[PATCH v3 18/21] fuse: Implement multi-threading

2025-07-01 Thread Hanna Czenczek
o: 746.9k ±2.8k (+167 %) rand aio: 749.0k ±4.9k (+168 %) seq sync: 420.7k ±3.1k (+ 37 %) rand sync: 419.1k ±2.5k (+ 37 %) So this helps mainly for the AIO cases, but also in the null sync cases, because null is always CPU-bound, so more threads help. S

[PATCH v3 02/21] fuse: Ensure init clean-up even with error_fatal

2025-07-01 Thread Hanna Czenczek
: Hanna Czenczek --- block/export/fuse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/export/fuse.c b/block/export/fuse.c index b967e88d2b..b224ce591d 100644 --- a/block/export/fuse.c +++ b/block/export/fuse.c @@ -119,6 +119,7 @@ static int fuse_export_create(BlockExport *blk_exp

[PATCH v3 09/21] fuse: Introduce fuse_{inc,dec}_in_flight()

2025-07-01 Thread Hanna Czenczek
This is how vduse-blk.c does it, and it does seem better to have dedicated functions for it. Reviewed-by: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 29 + 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/block/export/fuse.c

[PATCH v3 01/21] fuse: Copy write buffer content before polling

2025-07-01 Thread Hanna Czenczek
ing on. I will try to investigate further what the root cause is, but I think for now let's assume that calling blk_pwrite() can invalidate the buffer contents through nested polling. Cc: qemu-sta...@nongnu.org Reviewed-by: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- bloc

[PATCH v3 16/21] block/export: Add multi-threading interface

2025-07-01 Thread Hanna Czenczek
ead setting), but instead just pass a list to the export driver, with which it can do whatever it wants. Currently no export driver supports multi-threading, so they all return an error when receiving such a list. Suggested-by: Kevin Wolf Acked-by: Markus Armbruster Reviewed-by: Stefan Hajno

[PATCH v3 20/21] iotests/308: Add multi-threading sanity test

2025-07-01 Thread Hanna Czenczek
Run qemu-img bench on a simple multi-threaded FUSE export to test that it works. Reviewed-by: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- tests/qemu-iotests/308 | 51 ++ tests/qemu-iotests/308.out | 56 ++ 2 files

[PATCH v3 08/21] fuse: Introduce fuse_{at,de}tach_handlers()

2025-07-01 Thread Hanna Czenczek
Pull setting up and tearing down the AIO context handlers into two dedicated functions. Reviewed-by: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/block/export/fuse.c

[PATCH v3 11/21] fuse: Rename length to blk_len in fuse_write()

2025-07-01 Thread Hanna Czenczek
The term "length" is ambiguous, use "blk_len" instead to be clear. Reviewed-by: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/block/export/fuse.c b/block/export/fus

[PATCH v3 03/21] fuse: Remove superfluous empty line

2025-07-01 Thread Hanna Czenczek
Reviewed-by: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/export/fuse.c b/block/export/fuse.c index b224ce591d..a93316e1f4 100644 --- a/block/export/fuse.c +++ b/block/export/fuse.c @@ -464,7 +464,6 @@ static int

[PATCH v3 07/21] fuse: Set direct_io and parallel_direct_writes

2025-07-01 Thread Hanna Czenczek
ntent before polling" for further discussion.) Reviewed-by: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- block/export/fuse.c| 2 ++ tests/qemu-iotests/308.out | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/block/export/fuse.c b/block/export/fuse.c index

[PATCH v3 05/21] fuse: Change setup_... to mount_fuse_export()

2025-07-01 Thread Hanna Czenczek
: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 49 - 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/block/export/fuse.c b/block/export/fuse.c index 60d68d8fdd..01a5716bdd 100644 --- a/block/export/fuse.c +++ b

Re: [PATCH v2 18/21] fuse: Implement multi-threading

2025-07-01 Thread Hanna Czenczek
On 27.06.25 03:08, Brian wrote: On 6/4/25 9:28 AM, Hanna Czenczek wrote: FUSE allows creating multiple request queues by "cloning" /dev/fuse FDs (via open("/dev/fuse") + ioctl(FUSE_DEV_IOC_CLONE)). We can use this to implement multi-threading. For configuration, we

Re: [PATCH v2 12/21] block: Move qemu_fcntl_addfl() into osdep.c

2025-07-01 Thread Hanna Czenczek
On 09.06.25 17:03, Stefan Hajnoczi wrote: On Wed, Jun 04, 2025 at 03:28:04PM +0200, Hanna Czenczek wrote: Move file-posix's helper to add a flag (or a set of flags) to an FD's existing set of flags into osdep.c for other places to use. Suggested-by: Eric Blake Signed-off-by: Hann

Re: [PATCH v2 15/21] fuse: Process requests in coroutines

2025-06-05 Thread Hanna Czenczek
On 04.06.25 15:28, Hanna Czenczek wrote: Make fuse_process_request() a coroutine_fn (fuse_co_process_request()) and have read_from_fuse_fd() launch it inside of a newly created coroutine instead of running it synchronously. This way, we can process requests in parallel. These are the benchmark

[PATCH v2 03/21] fuse: Remove superfluous empty line

2025-06-04 Thread Hanna Czenczek
Reviewed-by: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/export/fuse.c b/block/export/fuse.c index b224ce591d..a93316e1f4 100644 --- a/block/export/fuse.c +++ b/block/export/fuse.c @@ -464,7 +464,6 @@ static int

[PATCH v2 15/21] fuse: Process requests in coroutines

2025-06-04 Thread Hanna Czenczek
: 141.1k ±2.9k (+ 66 % / + 11 %) So for non-AIO cases (and the null driver, which does not yield), there is little change; but for file AIO, results greatly improve, resolving the performance issue we saw before (when switching away from libfuse). Reviewed-by: Stefan Hajnoczi Signed-off-by: Hanna

[PATCH v2 21/21] fuse: Increase MAX_WRITE_SIZE with a second buffer

2025-06-04 Thread Hanna Czenczek
ng a 4G image (with qemu-img convert) to a FUSE export: - Before this patch: Takes 25.6 s (14.4 s with -t none) - After this patch: Takes 4.5 s (5.5 s with -t none) Reviewed-by: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 137 +

[PATCH v2 14/21] fuse: Reduce max read size

2025-06-04 Thread Hanna Czenczek
. (Larger requests are split automatically by the FUSE kernel driver anyway.) (Yes, we inadvertently already had parallel request processing due to nested polling before. Better to fix this late than never.) Reviewed-by: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 2

[PATCH v2 09/21] fuse: Introduce fuse_{inc,dec}_in_flight()

2025-06-04 Thread Hanna Czenczek
This is how vduse-blk.c does it, and it does seem better to have dedicated functions for it. Reviewed-by: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 29 + 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/block/export/fuse.c

[PATCH v2 13/21] fuse: Manually process requests (without libfuse)

2025-06-04 Thread Hanna Czenczek
ts in parallel.) In any case, once we use coroutines throughout the code, performance will improve again across the board. Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 754 +++- 1 file changed, 535 insertions(+), 219 deletions(-) diff --git a/b

[PATCH v2 19/21] qapi/block-export: Document FUSE's multi-threading

2025-06-04 Thread Hanna Czenczek
nting that is left for once that is done. Suggested-by: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- qapi/block-export.json | 5 + 1 file changed, 5 insertions(+) diff --git a/qapi/block-export.json b/qapi/block-export.json index 3ebad4ecef..f30690f54c 100644 --- a/qapi/block-export.json

[PATCH v2 05/21] fuse: Change setup_... to mount_fuse_export()

2025-06-04 Thread Hanna Czenczek
: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 49 - 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/block/export/fuse.c b/block/export/fuse.c index 60d68d8fdd..01a5716bdd 100644 --- a/block/export/fuse.c +++ b

[PATCH v2 10/21] fuse: Add halted flag

2025-06-04 Thread Hanna Czenczek
quest processing. We plan to only use this flag in cases that would effectively be kernel bugs. (Right now, the flag is unused because libfuse still does our request processing.) Reviewed-by: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- block/export/fuse.c

[PATCH v2 20/21] iotests/308: Add multi-threading sanity test

2025-06-04 Thread Hanna Czenczek
Run qemu-img bench on a simple multi-threaded FUSE export to test that it works. Signed-off-by: Hanna Czenczek --- tests/qemu-iotests/308 | 51 ++ tests/qemu-iotests/308.out | 56 ++ 2 files changed, 107 insertions(+) diff

[PATCH v2 12/21] block: Move qemu_fcntl_addfl() into osdep.c

2025-06-04 Thread Hanna Czenczek
Move file-posix's helper to add a flag (or a set of flags) to an FD's existing set of flags into osdep.c for other places to use. Suggested-by: Eric Blake Signed-off-by: Hanna Czenczek --- include/qemu/osdep.h | 1 + block/file-posix.c | 17 + util/osdep.c

[PATCH v2 11/21] fuse: Rename length to blk_len in fuse_write()

2025-06-04 Thread Hanna Czenczek
The term "length" is ambiguous, use "blk_len" instead to be clear. Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/block/export/fuse.c b/block/export/fuse.c index 044fbbf1fe..fd7887889

[PATCH v2 16/21] block/export: Add multi-threading interface

2025-06-04 Thread Hanna Czenczek
ead setting), but instead just pass a list to the export driver, with which it can do whatever it wants. Currently no export driver supports multi-threading, so they all return an error when receiving such a list. Suggested-by: Kevin Wolf Signed-off-by: Hanna Czenczek --- qapi/block-expor

[PATCH v2 18/21] fuse: Implement multi-threading

2025-06-04 Thread Hanna Czenczek
o: 746.9k ±2.8k (+167 %) rand aio: 749.0k ±4.9k (+168 %) seq sync: 420.7k ±3.1k (+ 37 %) rand sync: 419.1k ±2.5k (+ 37 %) So this helps mainly for the AIO cases, but also in the null sync cases, because null is always CPU-bound, so more threads help. S

[PATCH v2 04/21] fuse: Explicitly set inode ID to 1

2025-06-04 Thread Hanna Czenczek
Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/export/fuse.c b/block/export/fuse.c index a93316e1f4..60d68d8fdd 100644 --- a/block/export/fuse.c +++ b/block/export/fuse.c @@ -432,7 +432,7 @@ static void fuse_getattr

[PATCH v2 07/21] fuse: Set direct_io and parallel_direct_writes

2025-06-04 Thread Hanna Czenczek
ntent before polling" for further discussion.) Reviewed-by: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- block/export/fuse.c| 2 ++ tests/qemu-iotests/308.out | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/block/export/fuse.c b/block/export/fuse.c index

[PATCH v2 17/21] iotests/307: Test multi-thread export interface

2025-06-04 Thread Hanna Czenczek
Test the QAPI interface for multi-threaded exports. None of our exports currently support multi-threading, so it's always an error in the end, but we can still test the specific errors. Signed-off-by: Hanna Czenczek --- tests/qemu-iotests/307

[PATCH v2 02/21] fuse: Ensure init clean-up even with error_fatal

2025-06-04 Thread Hanna Czenczek
: Hanna Czenczek --- block/export/fuse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/export/fuse.c b/block/export/fuse.c index b967e88d2b..b224ce591d 100644 --- a/block/export/fuse.c +++ b/block/export/fuse.c @@ -119,6 +119,7 @@ static int fuse_export_create(BlockExport *blk_exp

[PATCH v2 08/21] fuse: Introduce fuse_{at,de}tach_handlers()

2025-06-04 Thread Hanna Czenczek
Pull setting up and tearing down the AIO context handlers into two dedicated functions. Reviewed-by: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/block/export/fuse.c

[PATCH v2 00/21] export/fuse: Use coroutines and multi-threading

2025-06-04 Thread Hanna Czenczek
017/21:[down] 'iotests/307: Test multi-thread export interface' 018/21:[0077] [FC] 'fuse: Implement multi-threading' 019/21:[down] 'qapi/block-export: Document FUSE's multi-threading' 020/21:[down] 'iotests/308: Add multi-threading sanity test' 021/

[PATCH v2 06/21] fuse: Fix mount options

2025-06-04 Thread Hanna Czenczek
- user_id/group_id: Mounter's UID/GID [1] It invokes fusermount3, an SUID libfuse helper program, which parses and processes some mount options before actually invoking the mount() system call. Reviewed-by: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- block/export/fus

[PATCH v2 01/21] fuse: Copy write buffer content before polling

2025-06-04 Thread Hanna Czenczek
ing on. I will try to investigate further what the root cause is, but I think for now let's assume that calling blk_pwrite() can invalidate the buffer contents through nested polling. Cc: qemu-sta...@nongnu.org Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 24

[PATCH 1/4] qcow2: Add keep_data_file command-line option

2025-05-30 Thread Hanna Czenczek
o use an existing data file, and you unset it when you want a new one. Getting an error when you expect to use an existing data file seems to me a nice warning that something is not right. Signed-off-by: Hanna Czenczek --- include/block/block_int-common.h | 1 + block/qc

[PATCH 3/4] iotests/common.filter: Sort keep_data_file

2025-05-30 Thread Hanna Czenczek
Sort the new keep_data_file creation option together with data_file and data_file_raw. Signed-off-by: Hanna Czenczek --- tests/qemu-iotests/common.filter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter index

[PATCH 0/4] qcow2: Add keep_data_file command-line option

2025-05-30 Thread Hanna Czenczek
. See patch 1 for more explanation. (See https://issues.redhat.com/browse/RHEL-73509 for perhaps a bit more context.) Hanna Czenczek (4): qcow2: Add keep_data_file command-line option qcow2: Simplify size round-up in co_create_opts iotests/common.filter: Sort keep_data_file iotests/244

[PATCH 4/4] iotests/244: Add test cases for keep_data_file

2025-05-30 Thread Hanna Czenczek
Add various test cases around keep_data_file to the existing data_file test suite 244. Signed-off-by: Hanna Czenczek --- tests/qemu-iotests/244 | 71 ++ tests/qemu-iotests/244.out | 53 2 files changed, 124 insertions(+) diff

[PATCH 2/4] qcow2: Simplify size round-up in co_create_opts

2025-05-30 Thread Hanna Czenczek
Use the now-existing qcow2_opts pointer to simplify the size rounding up code. Signed-off-by: Hanna Czenczek --- block/qcow2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index b11cbfd859..988ebcf138 100644 --- a/block/qcow2.c +++ b/block

Re: [PATCH v2] file-posix: Probe paths and retry SG_IO on potential path errors

2025-05-22 Thread Hanna Czenczek
ix.c | 115 - 1 file changed, 114 insertions(+), 1 deletion(-) Reviewed-by: Hanna Czenczek

Re: [PATCH] file-posix: Probe paths and retry SG_IO on potential path errors

2025-05-14 Thread Hanna Czenczek
any usable paths remained. If so, we can now retry the SG_IO ioctl and expect it to be sent to a working path. Signed-off-by: Kevin Wolf --- block/file-posix.c | 82 +- 1 file changed, 81 insertions(+), 1 deletion(-) Reviewed-by: Hanna Czenczek

Re: [PATCH 2/2] qcow2: put discards in discard queue when discard-no-unref is enabled

2025-05-12 Thread Hanna Czenczek
int64_t l1_table_offset, With the above done, for both patch 1 and 2: Reviewed-by: Hanna Czenczek

Re: [PATCH 1/3] block: add for_commit option to measure

2025-05-12 Thread Hanna Czenczek
On 16.04.25 09:16, Jean-Louis Dupond wrote: To specify we use measure call for commit size calculations, we add a new 'for_commit' option to the measure call. This will be used in following commit to do a different measurement. Why not allow specifying the node name (or filename) of the commit

Re: [PATCH v2 2/2] block/io: skip head/tail requests on EINVAL

2025-04-15 Thread Hanna Czenczek
On 11.04.25 19:28, Eric Blake wrote: On Fri, Apr 11, 2025 at 10:18:55AM +0200, Hanna Czenczek wrote: if (ret && ret != -ENOTSUP) { -goto out; +if (ret == -EINVAL && (offset % align != 0 || num % align != 0)) { Could use `(offset | num) %

Re: [PATCH v2 2/2] block/io: skip head/tail requests on EINVAL

2025-04-11 Thread Hanna Czenczek
uld use `(offset | num) % align != 0`, but either way: Reviewed-by: Hanna Czenczek +/* Silently skip rejected unaligned head/tail requests */ +} else { +goto out; /* bail out */ +} } offset += num;

Re: [PATCH v2 1/2] file-posix: probe discard alignment on Linux block devices

2025-04-11 Thread Hanna Czenczek
On 10.04.25 20:41, Stefan Hajnoczi wrote: Populate the pdiscard_alignment block limit so the block layer is able align discard requests correctly. Signed-off-by: Stefan Hajnoczi --- block/file-posix.c | 56 +- 1 file changed, 55 insertions(+), 1 de

Re: [PATCH for-10.0] scsi-disk: Apply error policy for host_status errors again

2025-04-08 Thread Hanna Czenczek
--- 1 file changed, 25 insertions(+), 14 deletions(-) Reviewed-by: Hanna Czenczek

[PATCH 01/15] fuse: Copy write buffer content before polling

2025-04-05 Thread Hanna Czenczek
on. I will try to investigate further what the root cause is, but I think for now let's assume that calling blk_pwrite() can invalidate the buffer contents through nested polling. Cc: qemu-sta...@nongnu.org Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 24 +---

Re: [PATCH 14/15] fuse: Implement multi-threading

2025-04-05 Thread Hanna Czenczek
On 26.03.25 06:38, Markus Armbruster wrote: Hanna Czenczek writes: FUSE allows creating multiple request queues by "cloning" /dev/fuse FDs (via open("/dev/fuse") + ioctl(FUSE_DEV_IOC_CLONE)). We can use this to implement multi-threading. Note that the interface present

Re: [PATCH 14/15] fuse: Implement multi-threading

2025-04-04 Thread Hanna Czenczek
On 01.04.25 14:05, Kevin Wolf wrote: Am 27.03.2025 um 14:45 hat Hanna Czenczek geschrieben: On 27.03.25 13:18, Markus Armbruster wrote: Hanna Czenczek writes: On 26.03.25 12:41, Markus Armbruster wrote: Hanna Czenczek writes: On 26.03.25 06:38, Markus Armbruster wrote: Hanna Czenczek

Re: [PATCH 01/15] fuse: Copy write buffer content before polling

2025-04-04 Thread Hanna Czenczek
On 01.04.25 15:44, Eric Blake wrote: On Tue, Mar 25, 2025 at 05:06:35PM +0100, Hanna Czenczek wrote: Polling in I/O functions can lead to nested read_from_fuse_export() calls, overwriting the request buffer's content. The only function affected by this is fuse_write(), which therefore mus

Re: [PATCH 15/15] fuse: Increase MAX_WRITE_SIZE with a second buffer

2025-04-04 Thread Hanna Czenczek
On 01.04.25 22:24, Eric Blake wrote: On Tue, Mar 25, 2025 at 05:06:55PM +0100, Hanna Czenczek wrote: We probably want to support larger write sizes than just 4k; 64k seems nice. However, we cannot read partial requests from the FUSE FD, we always have to read requests in full; so our read

Re: [PATCH 14/15] fuse: Implement multi-threading

2025-04-04 Thread Hanna Czenczek
On 27.03.25 16:55, Stefan Hajnoczi wrote: On Tue, Mar 25, 2025 at 05:06:54PM +0100, Hanna Czenczek wrote: FUSE allows creating multiple request queues by "cloning" /dev/fuse FDs (via open("/dev/fuse") + ioctl(FUSE_DEV_IOC_CLONE)). We can use this to implement multi-threa

Re: [PATCH 11/15] fuse: Manually process requests (without libfuse)

2025-04-04 Thread Hanna Czenczek
On 27.03.25 16:35, Stefan Hajnoczi wrote: On Tue, Mar 25, 2025 at 05:06:51PM +0100, Hanna Czenczek wrote: Manually read requests from the /dev/fuse FD and process them, without using libfuse. This allows us to safely add parallel request processing in coroutines later, without having to worry

Re: [PATCH 11/15] fuse: Manually process requests (without libfuse)

2025-04-04 Thread Hanna Czenczek
Sorry, replied too early. :) On 01.04.25 16:35, Eric Blake wrote: On Tue, Mar 25, 2025 at 05:06:51PM +0100, Hanna Czenczek wrote: Manually read requests from the /dev/fuse FD and process them, without using libfuse. This allows us to safely add parallel request processing in coroutines later

Re: [PATCH 11/15] fuse: Manually process requests (without libfuse)

2025-04-04 Thread Hanna Czenczek
On 01.04.25 16:35, Eric Blake wrote: On Tue, Mar 25, 2025 at 05:06:51PM +0100, Hanna Czenczek wrote: Manually read requests from the /dev/fuse FD and process them, without using libfuse. This allows us to safely add parallel request processing in coroutines later, without having to worry about

Re: [PATCH 08/15] fuse: Introduce fuse_{at,de}tach_handlers()

2025-04-04 Thread Hanna Czenczek
On 01.04.25 15:55, Eric Blake wrote: On Tue, Mar 25, 2025 at 05:06:48PM +0100, Hanna Czenczek wrote: Pull setting up and tearing down the AIO context handlers into two dedicated functions. Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 32 1 file

Re: [PATCH 01/15] fuse: Copy write buffer content before polling

2025-04-04 Thread Hanna Czenczek
On 27.03.25 15:47, Stefan Hajnoczi wrote: On Tue, Mar 25, 2025 at 05:06:35PM +0100, Hanna Czenczek wrote: Polling in I/O functions can lead to nested read_from_fuse_export() "Polling" means several different things. "aio_poll()" or "nested event loop" wou

Re: [PATCH 14/15] fuse: Implement multi-threading

2025-03-27 Thread Hanna Czenczek
On 27.03.25 13:18, Markus Armbruster wrote: Hanna Czenczek writes: On 26.03.25 12:41, Markus Armbruster wrote: Hanna Czenczek writes: On 26.03.25 06:38, Markus Armbruster wrote: Hanna Czenczek writes: FUSE allows creating multiple request queues by "cloning" /dev/fuse FDs

Re: [PATCH] Revert "iotests: Stop NBD server in test 162 before starting the next one"

2025-03-26 Thread Hanna Czenczek
ore. Signed-off-by: Thomas Huth --- tests/qemu-iotests/162 | 1 - 1 file changed, 1 deletion(-) With the hash fixed (or explained where I have to look :)): Reviewed-by: Hanna Czenczek

Re: [PATCH 14/15] fuse: Implement multi-threading

2025-03-26 Thread Hanna Czenczek
On 26.03.25 12:41, Markus Armbruster wrote: Hanna Czenczek writes: On 26.03.25 06:38, Markus Armbruster wrote: Hanna Czenczek writes: FUSE allows creating multiple request queues by "cloning" /dev/fuse FDs (via open("/dev/fuse") + ioctl(FUSE_DEV_IOC_CLONE)). We can u

Re: [PATCH 02/15] fuse: Ensure init clean-up even with error_fatal

2025-03-26 Thread Hanna Czenczek
On 26.03.25 06:47, Markus Armbruster wrote: Hanna Czenczek writes: When exports are created on the command line (with the storage daemon), errp is going to point to error_fatal. Without ERRP_GUARD, we would exit immediately when *errp is set, i.e. skip the clean-up code under the `fail

[PATCH 07/15] fuse: Set direct_io and parallel_direct_writes

2025-03-25 Thread Hanna Czenczek
ntent before polling" for further discussion.) Signed-off-by: Hanna Czenczek --- block/export/fuse.c| 2 ++ tests/qemu-iotests/308.out | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/block/export/fuse.c b/block/export/fuse.c index 0d20995a0e..2df6297d61 100644 -

[PATCH 06/15] fuse: Fix mount options

2025-03-25 Thread Hanna Czenczek
- user_id/group_id: Mounter's UID/GID [1] It invokes fusermount3, an SUID libfuse helper program, which parses and processes some mount options before actually invoking the mount() system call. Signed-off-by: Hanna Czenczek --- block/export/fuse.c| 14 +++--- tests/q

[PATCH 02/15] fuse: Ensure init clean-up even with error_fatal

2025-03-25 Thread Hanna Czenczek
has no actual impact right now[1], but it is still better to make this right. [1] Not cleaning up the mount point is the only thing I can imagine would be problematic, but that is the last thing we attempt, so if it fails, it will clean itself up. Signed-off-by: Hanna Czenczek --- block

[PATCH 14/15] fuse: Implement multi-threading

2025-03-25 Thread Hanna Czenczek
±2.8k (+167 %) rand aio: 749.0k ±4.9k (+168 %) seq sync: 420.7k ±3.1k (+ 37 %) rand sync: 419.1k ±2.5k (+ 37 %) So this helps mainly for the AIO cases, but also in the null sync cases, because null is always CPU-bound, so more threads help. Signed-off-by: Hanna Czenczek -

[PATCH 00/15] export/fuse: Use coroutines and multi-threading

2025-03-25 Thread Hanna Czenczek
. Then, this series makes request processing run in coroutines. Finally, it adds FUSE multi-threading (i.e. one FUSE FD per I/O thread). Hanna Czenczek (15): fuse: Copy write buffer content before polling fuse: Ensure init clean-up even with error_fatal fuse: Remove superfluous empty line

[PATCH 08/15] fuse: Introduce fuse_{at,de}tach_handlers()

2025-03-25 Thread Hanna Czenczek
Pull setting up and tearing down the AIO context handlers into two dedicated functions. Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/block/export/fuse.c b/block/export/fuse.c index

[PATCH 11/15] fuse: Manually process requests (without libfuse)

2025-03-25 Thread Hanna Czenczek
ts in parallel.) In any case, once we use coroutines throughout the code, performance will improve again across the board. Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 793 +++- 1 file changed, 567 insertions(+), 226 deletions(-) diff --git a/b

[PATCH 13/15] fuse: Process requests in coroutines

2025-03-25 Thread Hanna Czenczek
: 141.1k ±2.9k (+ 66 % / + 11 %) So for non-AIO cases (and the null driver, which does not yield), there is little change; but for file AIO, results greatly improve, resolving the performance issue we saw before (when switching away from libfuse). Signed-off-by: Hanna Czenczek --- block/export

[PATCH 12/15] fuse: Reduce max read size

2025-03-25 Thread Hanna Czenczek
. (Larger requests are split automatically by the FUSE kernel driver anyway.) (Yes, we inadvertently already had parallel request processing due to nested polling before. Better to fix this late than never.) Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 2 +- 1 file changed, 1

[PATCH 09/15] fuse: Introduce fuse_{inc,dec}_in_flight()

2025-03-25 Thread Hanna Czenczek
This is how vduse-blk.c does it, and it does seem better to have dedicated functions for it. Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 29 + 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/block/export/fuse.c b/block/export/fuse.c index

[PATCH 10/15] fuse: Add halted flag

2025-03-25 Thread Hanna Czenczek
quest processing. We plan to only use this flag in cases that would effectively be kernel bugs. (Right now, the flag is unused because libfuse still does our request processing.) Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 30 ++ 1 file changed, 30 inser

[PATCH 15/15] fuse: Increase MAX_WRITE_SIZE with a second buffer

2025-03-25 Thread Hanna Czenczek
ng a 4G image (with qemu-img convert) to a FUSE export: - Before this patch: Takes 25.6 s (14.4 s with -t none) - After this patch: Takes 4.5 s (5.5 s with -t none) Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 137 ++-- 1 file changed, 118

[PATCH 03/15] fuse: Remove superfluous empty line

2025-03-25 Thread Hanna Czenczek
Signed-off-by: Hanna Czenczek --- block/export/fuse.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/export/fuse.c b/block/export/fuse.c index 7c035dd6ca..17ad1d7b90 100644 --- a/block/export/fuse.c +++ b/block/export/fuse.c @@ -464,7 +464,6 @@ static int fuse_do_truncate(const

[PATCH 05/15] fuse: Change setup_... to mount_fuse_export()

2025-03-25 Thread Hanna Czenczek
: Hanna Czenczek --- block/export/fuse.c | 49 - 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/block/export/fuse.c b/block/export/fuse.c index 10606454c3..7bdec43b5c 100644 --- a/block/export/fuse.c +++ b/block/export/fuse.c @@ -72,8

[PATCH 04/15] fuse: Explicitly set inode ID to 1

2025-03-25 Thread Hanna Czenczek
Setting .st_ino to the FUSE inode ID is kind of arbitrary. While in practice it is going to be fixed (to FUSE_ROOT_ID, which is 1) because we only have the root inode, that is not obvious in fuse_getattr(). Just explicitly set it to 1 (i.e. no functional change). Signed-off-by: Hanna Czenczek

Re: [PATCH] block/rbd: Do not use BDS's AioContext

2025-02-12 Thread Hanna Czenczek
On 12.02.25 14:26, Kevin Wolf wrote: Am 12.02.2025 um 10:32 hat Hanna Czenczek geschrieben: RBD schedules the request completion code (qemu_rbd_finish_bh()) to run in the BDS's AioContext. The intent seems to be to run it in the same context that the original request coroutine ran in, i.e

[PATCH] block/rbd: Do not use BDS's AioContext

2025-02-12 Thread Hanna Czenczek
with multiqueue, that thread is not necessarily the same as the BDS's AioContext. Instead, we need to remember the actual AioContext and schedule the completion BH there. Buglink: https://issues.redhat.com/browse/RHEL-67115 Reported-by: Junyao Zhao Signed-off-by: Hanna Czenczek --- I think I

Re: Call for GSoC internship project ideas

2025-02-07 Thread Hanna Czenczek
On 07.02.25 14:41, Stefan Hajnoczi wrote: On Fri, Feb 7, 2025 at 7:35 AM Hanna Czenczek wrote: On 28.01.25 17:16, Stefan Hajnoczi wrote: Dear QEMU and KVM communities, QEMU will apply for the Google Summer of Code internship program again this year. Regular contributors can submit project

Re: Call for GSoC internship project ideas

2025-02-07 Thread Hanna Czenczek
ory: https://gitlab.com/virtio-fs/virtiofsd * virtiofsd’s filesystem operations: https://gitlab.com/virtio-fs/virtiofsd/-/blob/main/src/passthrough/mod.rs#L1490 * virtiofsd’s request processing loop: https://gitlab.com/virtio-fs/virtiofsd/-/blob/main/src/vhost_user.rs#L244 '''Details:''' * Skill level: intermediate * Language: Rust * Mentors: Hanna Czenczek (hre...@redhat.com), German Maglione (gmagli...@redhat.com)

[PATCH v2] migration: Ensure vmstate_save() sets errp

2024-10-15 Thread Hanna Czenczek
ng the state from a virtio-fs back-end (virtiofsd) fails. Signed-off-by: Hanna Czenczek --- v2: As suggested by Peter, after vmsd->post_save(), change the condition from `if (!ret)` to `if (!ret && ps_ret)` so we will not create an error object in case of success (that would the

  1   2   3   4   5   6   >