From: Stefan Hajnoczi <stefanha@redhat.com>
To: saz97 <sa.z@qq.com>
Cc: qemu-devel@nongnu.org, hreitz@redhat.com, kwolf@redhat.com,
qemu-block@nongnu.org
Subject: Re: [PATCH 0/1 RFC] FUSE Export Coroutine Integration Cover Letter
Date: Mon, 24 Mar 2025 10:41:26 -0400 [thread overview]
Message-ID: <20250324144126.GA64982@fedora> (raw)
In-Reply-To: <tencent_4E3504A0739AEE8199766C5415093D24CE05@qq.com>
[-- Attachment #1: Type: text/plain, Size: 3732 bytes --]
On Mon, Mar 24, 2025 at 04:05:09PM +0800, saz97 wrote:
> This patch series refactors QEMU's FUSE export module to leverage coroutines for read/write operations,
> addressing concurrency limitations and aligning with QEMU's asynchronous I/O model. The changes
> demonstrate measurable performance improvements while simplifying resource management.
>
> 1. technology implementation
>
> according to Stefan suggerstion, i move the processing logic of read_from_fuse_export into a coroutine for buffer management.
> and change the fuse_getattr to call: bdrv_co_get_allocated_file_size().
>
> 2. performance summary
>
> For the coroutine_integration_fuse test, the average results for iodepth=1 and iodepth=64 are as follows:
> -------------------------------
> Average results for iodepth=1:
> Read_IOPS: coroutine_integration_fuse: 4492.88 | origin: 4309.39 | 4.25% improvement
> Write_IOPS: coroutine_integration_fuse: 4500.68 | origin: 4318.68 | 4.21% improvement
> Read_BW: coroutine_integration_fuse: 17971.00 KB/s | origin: 17237.30 KB/s | 4.26% improvement
> Write_BW: coroutine_integration_fuse: 18002.50 KB/s | origin: 17274.30 KB/s | 4.23% improvement
> --------------------------------
> -------------------------------
> Average results for iodepth=64:
> Read_IOPS: coroutine_integration_fuse: 5576.93 | origin: 5347.13 | 4.29% improvement
> Write_IOPS: coroutine_integration_fuse: 5569.55 | origin: 5337.33 | 4.33% improvement
> Read_BW: coroutine_integration_fuse: 22311.40 KB/s | origin: 21392.20 KB/s | 4.31% improvement
> Write_BW: coroutine_integration_fuse: 22282.20 KB/s | origin: 21353.20 KB/s | 4.34% improvement
> --------------------------------
> Although all metrics show improvements, the gains are concentrated in the 4.2%–4.3% range, which is lower than expected. Further investigation using gprof reveals the reasons for this limited improvement.
>
> 3. Performance Bottlenecks Identified via gprof
> After running a fio test with the following command:
> fio --ioengine=io_uring --numjobs=1 --runtime=30 --ramp_time=5 \
> --rw=randrw --bs=4k --time_based=1 --name=job1 \
> --filename=/mnt/qemu-fuse --iopath=64
> and analyzing the execution profile using gprof, the following issues were identified:
>
> 3.1 Increased Overall Execution Time
> In the original implementation, fuse_write + blk_pwrite accounted for 8.7% of total execution time (6.0% + 2.7%).
> After refactoring, fuse_write_coroutine + blk_co_pwrite now accounts for 43.1% (22.9% + 20.2%).
> This suggests that coroutine overhead is contributing significantly to execution time.
>
> 3.2 Increased Read and Write Calls
> fuse_write calls increased from 173,400 → 333,232.
> fuse_read calls increased from 173,526 → 332,931.
> This indicates that the coroutine-based approach is introducing redundant I/O calls, likely due to unnecessary coroutine switches.
>
> 3.3 Significant Coroutine Overhead
> qemu_coroutine_enter is now called 1,572,803 times, compared to ~476,057 previously.
> This frequent coroutine switching introduces unnecessary overhead, limiting the expected performance improvements.
Due to the remaining performance issues, let's leave this contribution
task here.
Please focus on submitting your Google Summer of Code application at
https://summerofcode.withgoogle.com/ by April 8th.
Thanks,
Stefan
>
> saz97 (1):
> Integration coroutines into fuse export
>
> block/export/fuse.c | 190 +++++++++++++++++++++++++++++---------------
> 1 file changed, 126 insertions(+), 64 deletions(-)
>
> --
> 2.34.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2025-03-24 14:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-24 8:05 [PATCH 0/1 RFC] FUSE Export Coroutine Integration Cover Letter saz97
2025-03-24 14:41 ` Stefan Hajnoczi [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-03-15 17:30 saz97
2025-03-17 20:56 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250324144126.GA64982@fedora \
--to=stefanha@redhat.com \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sa.z@qq.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.