From: "Chris Mason" <clm@fb.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: Jes Sorensen <jes@trained-monkey.org>,
<linux-fscrypt@vger.kernel.org>, Theodore Ts'o <tytso@mit.edu>
Subject: Re: fsverity PAGE_SIZE constraints
Date: Wed, 03 Jun 2020 09:57:12 -0400 [thread overview]
Message-ID: <6AC8982D-797B-4FC1-9A08-72271CF0AAE0@fb.com> (raw)
In-Reply-To: <20200602215021.GB229073@gmail.com>
On 2 Jun 2020, at 17:50, Eric Biggers wrote:
> On Tue, Jun 02, 2020 at 11:49:36AM -0400, Chris Mason wrote:
>> On the btrfs side, I’m storing the fsverity data in the btree, so
>> I’m merkle
>> block size agnostic. Since our rollout is going to be x86, we’ll
>> end up
>> using the 4k size internally for the current code base.
>>
>> My recommendation to simplify the merkle tree code would be to just
>> put it
>> in slab objects instead pages and leverage recent MM changes to make
>> reclaim
>> work well. There’s probably still more to do on that front, but
>> it’s a long
>> standing todo item for Josef to shift the btrfs metadata out of the
>> page
>> cache, where we have exactly the same problems for exactly the same
>> reasons.
>
> Do you have an idea for how to do that without introducing much extra
> overhead
> to ext4 and f2fs with Merkle tree block size == PAGE_SIZE? Currently
> they just
> cache the Merkle tree pages in the inode's page cache. We don't
> *have* to do it
> that way, but anything that adds additional overhead (e.g. reading
> data into
> pagecache, then copying it into slab allocations, then freeing the
> pagecache
> pages) would be undesirable. We need to keep the overhead minimal.
You can do the IO directly into the slab pages, so there won’t be
extra copies, but there would be some extra code for ext4/f2fs because
you’ve been reusing the existing readpages machinery. I’d start
with the copies into slab just because all the complexity is in reclaim,
and adding FS helpers for file IO into specific pages is pretty well
understood.
Slab reclaim is a little clunky in comparison to the page cache. But,
it does give you the chance to do merkle aware reclaim, pitching the
blocks that are the least expensive to reread from an CPU/IO POV. It
also gives you the chance to strongly prefer not pitching any merkle
pages at all, which might be useful to help limit the cost of thrashing
in low memory situations.
-chris
prev parent reply other threads:[~2020-06-03 13:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-01 20:13 fsverity PAGE_SIZE constraints Jes Sorensen
2020-06-01 20:36 ` Eric Biggers
2020-06-02 15:49 ` Chris Mason
2020-06-02 21:50 ` Eric Biggers
2020-06-03 13:57 ` Chris Mason [this message]
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=6AC8982D-797B-4FC1-9A08-72271CF0AAE0@fb.com \
--to=clm@fb.com \
--cc=ebiggers@kernel.org \
--cc=jes@trained-monkey.org \
--cc=linux-fscrypt@vger.kernel.org \
--cc=tytso@mit.edu \
/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