Return-Path: Received: from out1-smtp.messagingengine.com ([66.111.4.25]:56821 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751675AbdIUR7M (ORCPT ); Thu, 21 Sep 2017 13:59:12 -0400 From: Nikolaus Rath To: Miklos Szeredi Cc: Miklos Szeredi , fuse-devel , Maxim Patlasov , linux-fsdevel Subject: Re: [fuse-devel] [fuse] getattr() results ignored when writeback cache is active References: <87zi9pk2ra.fsf@vostro.rath.org> <87vakdjsjj.fsf@vostro.rath.org> <87r2v1jphd.fsf@vostro.rath.org> Date: Thu, 21 Sep 2017 18:59:09 +0100 In-Reply-To: (Miklos Szeredi's message of "Thu, 21 Sep 2017 17:04:46 +0200") Message-ID: <87tvzw9bma.fsf@vostro.rath.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sep 21 2017, Miklos Szeredi wrote: > Thanks for your feedback. Fixed and expanded version: > > 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 wri= tes. > 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 con= sistent > 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 previou= sly > uncached, but fully written pages). No READ requests are ever sent for w= rites, > 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 p= age > reclaim on memory pressure) or explicitly (invoked by fsync(2)). I think it would be useful to mention if the cache is flushed when the file is not opened anymore, or (if not) to explicitly say that that's not the case. > This mode assumes that the file is never changed outside the mounted > filesystem This sounds a little awkward. How about "assumes that all changes to the filesystem go through the FUSE kernel module" > (the size time attributes are kept uptodate by the kernel), "size and atime/ctime/mtime attributes", and I think "uptodate" should be up-to-date. > so it's not suitable for any any network filesystem duplicated "any" I think this is great. I may work on similar documentation for some of the other stuff that currently lives only in include/fuse*.h Best, -Nikolaus --=20 GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F =C2=BBTime flies like an arrow, fruit flies like a Banana.=C2= =AB