public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Eric Van Hensbergen <ericvh@kernel.org>,
	Dominique Martinet <asmadeus@codewreck.org>,
	Latchesar Ionkov <lucho@ionkov.net>
Cc: David Howells <dhowells@redhat.com>,
	Christian Schoenebeck <linux_oss@crudebyte.com>,
	Matthew Wilcox <willy@infradead.org>,
	Jeff Layton <jlayton@kernel.org>,
	Christian Brauner <christian@brauner.io>,
	netfs@lists.linux.dev, v9fs@lists.linux.dev,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [RFC PATCH 2/3] 9p: Make better use of netfslib's writethrough caching
Date: Mon, 29 Jan 2024 11:54:36 +0000	[thread overview]
Message-ID: <20240129115512.1281624-3-dhowells@redhat.com> (raw)
In-Reply-To: <20240129115512.1281624-1-dhowells@redhat.com>

netfslib offers the opportunity to do a form of writethrough caching on the
pagecache, whereby netfs_perform_write() will set up and dispatch writes to
the network as it copies data into the cache, falling back to the ordinary
writeback path for the dirty data if this fails.  This is selected if the
user sets O_DSYNC, O_SYNC, RWF_DSYNC or RWF_SYNC or if the filesystem sets
NETFS_ICTX_WRITETHROUGH.

Change v9fs_fid_add_modes() to use this if O_DSYNC is set - and assuming
that CACHE_WRITEBACK is set and V9FS_SYNC is not set.

[?] Does it make sense to add an additional caching mode that uses
    write-through for all non-DIO writes?

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Eric Van Hensbergen <ericvh@kernel.org>
cc: Latchesar Ionkov <lucho@ionkov.net>
cc: Dominique Martinet <asmadeus@codewreck.org>
cc: Christian Schoenebeck <linux_oss@crudebyte.com>
cc: Jeff Layton <jlayton@kernel.org>
cc: v9fs@lists.linux.dev
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
---
 fs/9p/fid.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/9p/fid.h b/fs/9p/fid.h
index 29281b7c3887..0b25b4c9781d 100644
--- a/fs/9p/fid.h
+++ b/fs/9p/fid.h
@@ -56,8 +56,7 @@ static inline void v9fs_fid_add_modes(struct p9_fid *fid, unsigned int s_flags,
 	   ((fid->qid.version == 0) && !(s_flags & V9FS_IGNORE_QV)) ||
 	   (s_flags & V9FS_DIRECT_IO) || (f_flags & O_DIRECT)) {
 		fid->mode |= P9L_DIRECT; /* no read or write cache */
-	} else if ((!(s_cache & CACHE_WRITEBACK)) ||
-				(f_flags & O_DSYNC) || (s_flags & V9FS_SYNC)) {
+	} else if ((!(s_cache & CACHE_WRITEBACK)) || (s_flags & V9FS_SYNC)) {
 		fid->mode |= P9L_NOWRITECACHE;
 	}
 }


  parent reply	other threads:[~2024-01-29 11:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-29 11:54 [RFC PATCH 0/3] 9p: Further netfslib-related changes David Howells
2024-01-29 11:54 ` [RFC PATCH 1/3] 9p: Enable large folio support David Howells
2024-01-29 11:54 ` David Howells [this message]
2024-01-29 11:54 ` [RFC PATCH 3/3] 9p: Always update remote_i_size in stat2inode David Howells
2024-01-29 14:14 ` [RFC PATCH 0/3] 9p: Further netfslib-related changes Christian Schoenebeck
2024-01-29 14:22   ` David Howells
2024-01-29 20:53     ` Christian Schoenebeck

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=20240129115512.1281624-3-dhowells@redhat.com \
    --to=dhowells@redhat.com \
    --cc=asmadeus@codewreck.org \
    --cc=christian@brauner.io \
    --cc=ericvh@kernel.org \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux_oss@crudebyte.com \
    --cc=lucho@ionkov.net \
    --cc=netfs@lists.linux.dev \
    --cc=v9fs@lists.linux.dev \
    --cc=willy@infradead.org \
    /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