lkml.org 
[lkml]   [2014]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/6] fuse: wait for end of IO on release
On 08/22/2014 06:00 PM, Miklos Szeredi wrote:
> On Thu, Aug 21, 2014 at 6:08 PM, Maxim Patlasov <MPatlasov@parallels.com> wrote:
>> There are two types of I/O activity that can be "in progress" at the time
>> of fuse_release() execution: asynchronous read-ahead and write-back. The
>> patch ensures that they are completed before fuse_release_common sends
>> FUSE_RELEASE to userspace.
>>
>> So far as fuse_release() waits for end of async I/O, its callbacks
>> (fuse_readpages_end and fuse_writepage_finish) calling fuse_file_put cannot
>> be the last holders of fuse file anymore. To emphasize the fact, the patch
>> replaces fuse_file_put with __fuse_file_put there.
> 1) spinlock around __fuse_file_put() is unnecessary,
> wake_up/wait_event will provide the necessary synchronization.
Yes, I agree.

> 2) can't we always wait for I/O and just make the actual RELEASE
> message sync or async based on the flag?
> 3) and can't we merge the fuseblk case into this as well?

I think this is doable, but the same argument that Anand suggested for
doing sync release selectively:

> In a real world scenario you may want to perform synchronous release
> selectively. As such performance over lots of small files is generally
> slow because of context switches, and a synchronous release adds an
> extra switch.

is applicable here: if an application opened a file read-only and read a
block initiating read-ahead, it's not obvious why the app doing close(2)
should always wait for the end of that read-ahead. For some fs it's
desirable, for others is not. Let's fuse daemon decide which behaviour
is preferable.

Thanks,
Maxim


\
 
 \ /
  Last update: 2014-08-25 17:21    [W:1.882 / U:0.912 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site