qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 02/20] fuse: Allow exporting BDSs via FUSE


From: Kevin Wolf
Subject: Re: [PATCH v2 02/20] fuse: Allow exporting BDSs via FUSE
Date: Thu, 15 Oct 2020 19:01:21 +0200

Am 15.10.2020 um 17:59 hat Max Reitz geschrieben:
> On 15.10.20 17:41, Kevin Wolf wrote:
> > Am 15.10.2020 um 16:46 hat Max Reitz geschrieben:
> >> On 15.10.20 10:57, Kevin Wolf wrote:
> >>> Am 22.09.2020 um 12:49 hat Max Reitz geschrieben:
> 
> [...]
> 
> >>>> +static void fuse_export_shutdown(BlockExport *blk_exp)
> >>>> +{
> >>>> +    FuseExport *exp = container_of(blk_exp, FuseExport, common);
> >>>> +
> >>>> +    if (exp->fuse_session) {
> >>>> +        fuse_session_exit(exp->fuse_session);
> >>>> +
> >>>> +        if (exp->mounted) {
> >>>> +            fuse_session_unmount(exp->fuse_session);
> >>>> +            exp->mounted = false;
> >>>> +        }
> >>>> +
> >>>> +        if (exp->fd_handler_set_up) {
> >>>> +            aio_set_fd_handler(exp->common.ctx,
> >>>> +                               fuse_session_fd(exp->fuse_session), true,
> >>>> +                               NULL, NULL, NULL, NULL);
> >>>> +            exp->fd_handler_set_up = false;
> >>>> +        }
> >>>> +
> >>>> +        fuse_session_destroy(exp->fuse_session);
> >>>> +        exp->fuse_session = NULL;
> >>>
> >>> What happens if a request is still in flight?
> >>>
> >>> Oh, can't happen because the driver is fully synchronous after this
> >>> series. Fair enough, making it asynchronous can come on top of it.
> >>
> >> (I had multiple approaches of handling parallel requests, but none made
> >> a substantial performance difference, which is why I left the driver in
> >> the most simple form for this first proposal.)
> > 
> > I think the more relevant part is that we'd block the guest or anything
> > else running in the main loop while doing I/O.
> > 
> > Not a problem if you spawn a new qemu-storage-daemon just for this FUSE
> > export, but if you want to have multiple exports, or export from the
> > system emulator, you probably don't want to have synchronous operations.
> 
> Ah, hm.  Hmm. O:)
> 
> Does NBD work any different, though?  I had always assumed it runs in
> the BB’s context.

Yes, it runs in the BB's AioContext, but it's coroutine based, so
instead of blocking, it just yields and lets other stuff in the same
event loop make progress while it's waiting for its I/O.

Kevin

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]