From: Eric Biggers <ebiggers@kernel.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: Freeing page flags
Date: Fri, 13 May 2022 23:10:02 -0700 [thread overview]
Message-ID: <Yn9Huu//3AJ2hu/L@sol.localdomain> (raw)
In-Reply-To: <Yn10Iz1mJX1Mu1rv@casper.infradead.org>
On Thu, May 12, 2022 at 09:54:59PM +0100, Matthew Wilcox wrote:
> The LWN writeup [1] on merging the MGLRU reminded me that I need to send
> out a plan for removing page flags that we can do without.
>
> 1. PG_error. It's basically useless. If the page was read successfully,
> PG_uptodate is set. If not, PG_uptodate is clear. The page cache
> doesn't use PG_error. Some filesystems do, and we need to transition
> them away from using it.
One of the uses of PG_error is in ext4 and f2fs to keep track of decryption
(fscrypt) and verity (fs-verity) failures on pages in a bio being read.
Decryption and verity happen in separate phases, so PG_error is used to record
which subset of pages a decryption error occurred on. Similarly, PG_error is
also used to record which subset of pages a verity error occurred on, which the
filesystem uses to decide whether to set PG_uptodate afterwards.
If we had to get rid of it, one idea would be:
* Don't keep track of decryption failures on a per-page basis; just fail the
whole bio if one occurs. That's how the block layer works, after all; you
just get one ->bi_status and not an individual status for each page. Also,
decryption failures never really happen in practice anyway.
* Also merge together the verity step and the setting-uptodate+unlocking step,
so that PG_error isn't needed to propagate the page status between these.
This should work since verity only happens at the end anyway.
I was also thinking about just unlocking pages as errors occur on them. I think
that wouldn't work, because the filesystem wouldn't be able to distinguish
between pages it still has locked and pages that got re-locked by someone else.
- Eric
next prev parent reply other threads:[~2022-05-14 6:10 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-12 20:54 Matthew Wilcox
2022-05-13 2:41 ` Josef Bacik
2022-05-13 3:39 ` Matthew Wilcox
2022-05-13 9:40 ` Luís Henriques
2022-05-13 12:53 ` Matthew Wilcox
2022-05-13 13:18 ` Luís Henriques
2022-05-13 13:21 ` Jeff Layton
2022-05-13 13:38 ` Matthew Wilcox
2022-05-13 13:57 ` Jeff Layton
2022-05-17 0:34 ` Xiubo Li
2022-05-13 13:17 ` Josef Bacik
2022-05-13 3:46 ` Yu Zhao
2022-05-14 6:10 ` Eric Biggers [this message]
2022-05-23 6:38 ` Mike Rapoport
2022-06-10 17:39 ` David Hildenbrand
2022-05-30 16:54 ` David Hildenbrand
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=Yn9Huu//3AJ2hu/L@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--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