From: Nikolaus Rath <Nikolaus@rath.org>
To: Miklos Szeredi <mszeredi@redhat.com>
Cc: fuse-devel@lists.sourceforge.net,
Maxim Patlasov <mpatlasov@virtuozzo.com>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [fuse-devel] [fuse] getattr() results ignored when writeback cache is active
Date: Wed, 20 Sep 2017 17:37:18 +0100 [thread overview]
Message-ID: <87r2v1jphd.fsf@vostro.rath.org> (raw)
In-Reply-To: <CAOssrKeWuLfHE2W2_MGCgH6_j685p9xz_Uv9tQokDoz1a4vsYQ@mail.gmail.com> (Miklos Szeredi's message of "Wed, 20 Sep 2017 17:59:55 +0200")
On Sep 20 2017, Miklos Szeredi <mszeredi@redhat.com> wrote:
>>> Writeback cache assumes that the file is never changed outside the
>>> mounted filesystem, so it's not suitable for any network fs currently.
>>>
>>> Apparently the above is not documented anywhere :(
>>
>> Ouch.
>>
>> I will of course put this into the libfuse documentation, but it would
>> be much nicer if things like that could be documented somewhere in the
>> kernel. After all, these are not properties of libfuse but the kernel
>> module - and some filesystems use the fuse interface without using
>> libfuse.
>>
>> (This actually applies to large chunk of information that's currently
>> only in the libfuse documentation).
>>
>> Any chance of that happening? I understand that bringing
>> Documentation/filesystems/fuse.txt up to date would be a major
>> endeavour, but maybe one could just start by putting at least this
>> information into e.g. a new Documentation/filesystems/fuse/writeback.txt
>> file? Together with the requirement that the filesystem has to support
>> reading from files opened O_WRONLY?
>
> Something like this?
Anything is better than nothing. Well, almost anything, but that
definitely includes your draft :-).
> Fuse supports the following writeback modes:
"write modes", or maybe "access modes", not "writeback modes", right?
> - direct-io
> - write-through
> - writeback-cache
>
> In direct-io mode (enabled by the FOPEN_DIRECT_IO flag) the page cache is
> completely bypassed for reads and writes.
I'd add "No read-ahead takes place." (if that's true)
>
> In write-through mode (default) each write modifies the page cache as well as
> immediately being sent to userspace.
Reads may be satisfied from the page cache, and data may be read-ahead
by the kernel to fill the page-cache.
> In writeback-cache mode (enabled by the FUSE_WRITEBACK_CACHE flaga)
> writes go to
Typo in "flaga"
> the cache only, which means that the write(2) syscall can often complete very
> fast. The dirty pages are later sent to userspace using write
> requests.
I think it would be great to be more specific than "later". Maybe "when
the file is no longer opened by any process, when explicitly requested
by an fsync() call, or when the dirty data is evicted from the cache by
the kernel for other reasons" (if that's correct).
> This
> mode assumes that the file is never changed outside the mounted filesystem, so
> it's not suitable for any network fs. If a partial page is written, then the
> page needs to be first read from userspace. This means, thet even for
> files
"that", not "thet"
> opened for O_WRONLY it is possible that read requests will be generated by the
> kernel.
Nice!
Thanks!
-Nikolaus
--
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F
»Time flies like an arrow, fruit flies like a Banana.«
next prev parent reply other threads:[~2017-09-20 16:37 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-20 11:50 [fuse] getattr() results ignored when writeback cache is active Nikolaus Rath
2017-09-20 15:23 ` Miklos Szeredi
2017-09-20 15:31 ` [fuse-devel] " Nikolaus Rath
2017-09-20 15:59 ` Miklos Szeredi
2017-09-20 16:37 ` Nikolaus Rath [this message]
2017-09-21 15:04 ` Miklos Szeredi
2017-09-21 17:59 ` Nikolaus Rath
2017-09-25 9:12 ` Miklos Szeredi
2017-09-25 9:25 ` Nikolaus Rath
2017-09-21 10:12 ` Nikolaus Rath
2017-09-21 17:28 ` Maxim Patlasov
2017-09-21 17:53 ` Nikolaus Rath
2017-09-21 18:24 ` Maxim Patlasov
2017-09-21 18:31 ` Nikolaus Rath
2017-09-21 18:45 ` Maxim Patlasov
2017-09-21 19:21 ` Nikolaus Rath
2017-09-21 19:44 ` Maxim Patlasov
2017-09-22 9:34 ` Nikolaus Rath
2017-09-26 6:55 ` Maxim Patlasov
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=87r2v1jphd.fsf@vostro.rath.org \
--to=nikolaus@rath.org \
--cc=fuse-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mpatlasov@virtuozzo.com \
--cc=mszeredi@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).