linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Trond Myklebust <trondmy@hammerspace.com>
Cc: "hch@lst.de" <hch@lst.de>,
	"miklos@szeredi.hu" <miklos@szeredi.hu>,
	"dhowells@redhat.com" <dhowells@redhat.com>,
	"ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>,
	"linux-cifs@vger.kernel.org" <linux-cifs@vger.kernel.org>,
	"brauner@kernel.org" <brauner@kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"v9fs@lists.linux.dev" <v9fs@lists.linux.dev>,
	"netfs@lists.linux.dev" <netfs@lists.linux.dev>,
	"jlayton@kernel.org" <jlayton@kernel.org>,
	"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devel@lists.orangefs.org" <devel@lists.orangefs.org>,
	"linux-afs@lists.infradead.org" <linux-afs@lists.infradead.org>
Subject: Re: [RFC PATCH] mm, netfs: Provide a means of invalidation without using launder_folio
Date: Wed, 27 Mar 2024 17:46:52 +0000	[thread overview]
Message-ID: <ZgRbjAn-d3_SAaQJ@casper.infradead.org> (raw)
In-Reply-To: <37514eae34c02cefb11fc4c6d3f4ae2296fb6ab5.camel@hammerspace.com>

On Wed, Mar 27, 2024 at 03:56:50PM +0000, Trond Myklebust wrote:
> On Wed, 2024-03-27 at 15:04 +0000, David Howells wrote:
> > Implement a replacement for launder_folio[1].  The key feature of
> > invalidate_inode_pages2() is that it locks each folio individually,
> > unmaps
> > it to prevent mmap'd accesses interfering and calls the -
> > >launder_folio()
> > address_space op to flush it.  This has problems: firstly, each folio
> > is
> > written individually as one or more small writes; secondly, adjacent
> > folios
> > cannot be added so easily into the laundry; thirdly, it's yet another
> > op to
> > implement.
> 
> This is hardly a drop-in replacement for launder_page. The whole point
> of using invalidate_inode_pages2() was that it only requires taking the
> page locks, allowing us to use it in contexts such as
> nfs_release_file().
> 
> The above use of truncate_inode_pages_range() will require any caller
> to grab several locks in order to prevent data loss through races with
> write system calls.

I don't understand why you need launder_folio now
that you have a page_mkwrite implementation (your commit
e3db7691e9f3dff3289f64e3d98583e28afe03db used this as justification).
Other filesystems (except the network filesystems that copied the NFS
implementation) don't implement launder_folio.

  reply	other threads:[~2024-03-27 17:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27 15:04 [RFC PATCH] mm, netfs: Provide a means of invalidation without using launder_folio David Howells
2024-03-27 15:56 ` Trond Myklebust
2024-03-27 17:46   ` Matthew Wilcox [this message]
2024-03-27 17:55 ` [RFC PATCH v2] " David Howells
2024-03-27 18:45   ` Matthew Wilcox
2024-03-27 20:37   ` David Howells

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=ZgRbjAn-d3_SAaQJ@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=devel@lists.orangefs.org \
    --cc=dhowells@redhat.com \
    --cc=hch@lst.de \
    --cc=jlayton@kernel.org \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=netfs@lists.linux.dev \
    --cc=trondmy@hammerspace.com \
    --cc=v9fs@lists.linux.dev \
    --cc=viro@zeniv.linux.org.uk \
    /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).