[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y7mLtPpRz8boODVX@casper.infradead.org>
Date: Sat, 7 Jan 2023 15:11:48 +0000
From: Matthew Wilcox <willy@...radead.org>
To: David Howells <dhowells@...hat.com>
Cc: Rohith Surabattula <rohiths.msft@...il.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Steve French <sfrench@...ba.org>,
Shyam Prasad N <nspmangalore@...il.com>,
Dave Wysochanski <dwysocha@...hat.com>,
Dominique Martinet <asmadeus@...ewreck.org>,
Ilya Dryomov <idryomov@...il.com>,
Theodore Ts'o <tytso@....edu>,
Andreas Dilger <adilger.kernel@...ger.ca>,
linux-cachefs@...hat.com, linux-cifs@...r.kernel.org,
linux-afs@...ts.infradead.org,
v9fs-developer@...ts.sourceforge.net, ceph-devel@...r.kernel.org,
linux-nfs@...r.kernel.org, linux-ext4@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
Jeff Layton <jlayton@...nel.org>, linux-erofs@...ts.ozlabs.org,
linux-ext4@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 1/3] mm: Merge
folio_has_private()/filemap_release_folio() call pairs
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.
Powered by blists - more mailing lists