All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolaus Rath <Nikolaus@rath.org>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Miklos Szeredi <mszeredi@redhat.com>,
	fuse-devel <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: Mon, 25 Sep 2017 10:25:48 +0100	[thread overview]
Message-ID: <87lgl35dur.fsf@vostro.rath.org> (raw)
In-Reply-To: <20170925091218.GE19278@veci.piliscsaba.szeredi.hu> (Miklos Szeredi's message of "Mon, 25 Sep 2017 11:12:18 +0200")

On Sep 25 2017, Miklos Szeredi <miklos@szeredi.hu> wrote:
> Fuse supports the following I/O modes:
>
> - direct-io
> - cached
>   + write-through
>   + writeback-cache
>
> The direct-io mode can be selected with the FOPEN_DIRECT_IO flag in the
> FUSE_OPEN reply.
>
> In direct-io mode the page cache is completely bypassed for reads and writes.
> No read-ahead takes place. Shared mmap is disabled.
>
> In cached mode reads may be satisfied from the page cache, and data may be
> read-ahead by the kernel to fill the cache.  The cache is always kept consistent
> after any writes to the file.  All mmap modes are supported.
>
> The cached mode has two sub modes controlling how writes are handled.  The
> write-through mode is the default and is supported on all kernels.  The
> writeback-cache mode may be selected by the FUSE_WRITEBACK_CACHE flag in the
> FUSE_INIT reply.
>
> In write-through mode each write is immediately sent to userspace as one or more
> WRITE requests, as well as updating any cached pages (and caching previously
> uncached, but fully written pages).  No READ requests are ever sent for writes,
> so when an uncached page is partially written, the page is discarded.
>
> In writeback-cache mode (enabled by the FUSE_WRITEBACK_CACHE flag) writes go to
> the cache only, which means that the write(2) syscall can often complete very
> fast.  Dirty pages are written back implicitly (background writeback or page
> reclaim on memory pressure) or explicitly (invoked by close(2), fsync(2) and
> when the last ref to the file is being released on munmap(2)).  This mode
> assumes that all changes to the filesystem go through the FUSE kernel module
> (size and atime/ctime/mtime attributes are kept up-to-date by the kernel), so
> it's generally not suitable for network filesystems.  If a partial page is
> written, then the page needs to be first read from userspace.  This means, that
> even for files opened for O_WRONLY it is possible that READ requests will be
> generated by the kernel.


Looks great to me.


Best,
-Nikolaus

-- 
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«

  reply	other threads:[~2017-09-25 19:29 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
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 [this message]
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=87lgl35dur.fsf@vostro.rath.org \
    --to=nikolaus@rath.org \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --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 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.