From: Matthew Wilcox <willy@infradead.org>
To: David Howells <dhowells@redhat.com>
Cc: Rohith Surabattula <rohiths.msft@gmail.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Steve French <sfrench@samba.org>,
Shyam Prasad N <nspmangalore@gmail.com>,
Dave Wysochanski <dwysocha@redhat.com>,
Dominique Martinet <asmadeus@codewreck.org>,
Ilya Dryomov <idryomov@gmail.com>, Theodore Ts'o <tytso@mit.edu>,
Andreas Dilger <adilger.kernel@dilger.ca>,
linux-cachefs@redhat.com, linux-cifs@vger.kernel.org,
linux-afs@lists.infradead.org,
v9fs-developer@lists.sourceforge.net, ceph-devel@vger.kernel.org,
linux-nfs@vger.kernel.org, linux-ext4@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
Jeff Layton <jlayton@kernel.org>,
linux-erofs@lists.ozlabs.org, linux-ext4@lists.ozlabs.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 1/3] mm: Merge folio_has_private()/filemap_release_folio() call pairs
Date: Sat, 7 Jan 2023 15:11:48 +0000 [thread overview]
Message-ID: <Y7mLtPpRz8boODVX@casper.infradead.org> (raw)
In-Reply-To: <167172132272.2334525.13617516784050484518.stgit@warthog.procyon.org.uk>
On Thu, Dec 22, 2022 at 03:02:02PM +0000, David Howells wrote:
> Make filemap_release_folio() check folio_has_private(). Then, in most
> cases, where a call to folio_has_private() is immediately followed by a
> call to filemap_release_folio(), we can get rid of the test in the pair.
>
> The same is done to page_has_private()/try_to_release_page() call pairs.
This line is now obsolete.
> There are a couple of sites in mm/vscan.c that this can't so easily be
> done. In shrink_folio_list(), there are actually three cases (something
> different is done for incompletely invalidated buffers), but
> filemap_release_folio() elides two of them.
>
> In shrink_active_list(), we don't have have the folio lock yet, so the
> check allows us to avoid locking the page unnecessarily.
>
> A wrapper function to check if a folio needs release is provided for those
> places that still need to do it in the mm/ directory. This will acquire
> additional parts to the condition in a future patch.
>
> After this, the only remaining caller of folio_has_private() outside of mm/
> is a check in fuse.
But there are a few remaining places which check page_has_private().
I think they're all wrong and should be PagePrivate(), but I'll look
at them more next week.
next prev parent reply other threads:[~2023-01-07 15:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-22 15:01 [PATCH v5 0/3] mm, netfs, fscache: Stop read optimisation when folio removed from pagecache David Howells
2022-12-22 15:02 ` [PATCH v5 1/3] mm: Merge folio_has_private()/filemap_release_folio() call pairs David Howells
2023-01-07 15:11 ` Matthew Wilcox [this message]
2022-12-22 15:02 ` [PATCH v5 2/3] mm, netfs, fscache: Stop read optimisation when folio removed from pagecache David Howells
2023-02-16 13:58 ` David Wysochanski
2022-12-22 15:02 ` [PATCH v5 3/3] mm: Make filemap_release_folio() better inform shrink_folio_list() David Howells
2022-12-23 15:31 ` Christoph Hellwig
2023-01-07 15:06 ` Matthew Wilcox
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=Y7mLtPpRz8boODVX@casper.infradead.org \
--to=willy@infradead.org \
--cc=adilger.kernel@dilger.ca \
--cc=asmadeus@codewreck.org \
--cc=ceph-devel@vger.kernel.org \
--cc=dhowells@redhat.com \
--cc=dwysocha@redhat.com \
--cc=idryomov@gmail.com \
--cc=jlayton@kernel.org \
--cc=linux-afs@lists.infradead.org \
--cc=linux-cachefs@redhat.com \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-ext4@lists.ozlabs.org \
--cc=linux-ext4@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=nspmangalore@gmail.com \
--cc=rohiths.msft@gmail.com \
--cc=sfrench@samba.org \
--cc=torvalds@linux-foundation.org \
--cc=tytso@mit.edu \
--cc=v9fs-developer@lists.sourceforge.net \
/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).