From: Brian Song <hibriansong@gmail.com>
To: Bernd Schubert <bschubert@ddn.com>,
"qemu-block@nongnu.org" <qemu-block@nongnu.org>
Cc: Kevin Wolf <kwolf@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [QEMU/FUSE] Discussion on Proper Termination and Async Cancellation in fuse-over-io_uring
Date: Tue, 5 Aug 2025 00:11:13 -0400 [thread overview]
Message-ID: <dbcfecfd-01ab-4ca4-b835-f3a3e6b3686e@gmail.com> (raw)
In-Reply-To: <577bf373-92cb-4160-a49e-e29d3615a308@ddn.com>
On 2025-08-04 7:33 a.m., Bernd Schubert wrote:
> Hi Brian,
>
> sorry for my late reply, just back from vacation and fighting through
> my mails.
>
> On 8/4/25 01:33, Brian Song wrote:
>>
>>
>> On 2025-08-01 12:09 p.m., Brian Song wrote:
>>> Hi Bernd,
>>>
>>> We are currently working on implementing termination support for fuse-
>>> over-io_uring in QEMU, and right now we are focusing on how to clean up
>>> in-flight SQEs properly. Our main question is about how well the kernel
>>> supports robust cancellation for these fuse-over-io_uring SQEs. Does it
>>> actually implement cancellation beyond destroying the io_uring queue?
>>> [...]
>>
>
> I have to admit that I'm confused why you can't use umount, isn't that
> the most graceful way to shutdown a connection?
>
> If you need another custom way for some reasons, we probably need
> to add it.
>
>
> Thanks,
> Bernd
Hi Bernd,
Thanks for your insights!
I think umount doesn't cancel any pending SQEs, right? From what I see,
the only way to cancel all pending SQEs and transition all entries to
the FRRS_USERSPACE state (unavailable for further fuse requests) in the
kernel is by calling io_uring_files_cancel in do_exit, or
io_uring_task_cancel in begin_new_exec.
From my understanding, QEMU follows an event-driven model. So if we
don't cancel the SQEs submitted by a connection when it ends, then
before QEMU exits — after the connection is closed and the associated
FUSE data structures have been freed — any CQE that comes back will
trigger QEMU to invoke a previously deleted CQE handler, leading to a
segfault.
So if the only way to make all pending entries unavailable in the kernel
is calling do_exit or begin_new_exec, I think we should do some
workarounds in QEMU.
Thanks,
Brian
next prev parent reply other threads:[~2025-08-05 4:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-01 16:09 [QEMU/FUSE] Discussion on Proper Termination and Async Cancellation in fuse-over-io_uring Brian Song
2025-08-03 23:33 ` Brian Song
2025-08-04 11:33 ` Bernd Schubert
2025-08-04 12:29 ` Kevin Wolf
2025-08-05 4:11 ` Brian Song [this message]
2025-08-07 9:05 ` Bernd Schubert
2025-08-07 15:15 ` 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=dbcfecfd-01ab-4ca4-b835-f3a3e6b3686e@gmail.com \
--to=hibriansong@gmail.com \
--cc=bschubert@ddn.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).