From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Biggers Date: Fri, 7 Apr 2023 19:56:36 +0000 Subject: [Cluster-devel] [PATCH v2 21/23] xfs: handle merkle tree block size != fs blocksize != PAGE_SIZE In-Reply-To: <20230406004434.GA879@sol.localdomain> References: <20230404145319.2057051-1-aalbersh@redhat.com> <20230404145319.2057051-22-aalbersh@redhat.com> <20230404163602.GC109974@frogsfrogsfrogs> <20230405160221.he76fb5b45dud6du@aalbersh.remote.csb> <20230405163847.GG303486@frogsfrogsfrogs> <20230405222646.GR3223426@dread.disaster.area> <20230405233753.GU3223426@dread.disaster.area> <20230406004434.GA879@sol.localdomain> Message-ID: List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Wed, Apr 05, 2023 at 05:44:36PM -0700, Eric Biggers wrote: > > Not vmalloc'ed, but vmapped. we allocate the pages individually, but > > then call vm_map_page() to present the higher level code with a > > single contiguous memory range if it is a multi-page buffer. > > > > We do have the backing info held in the buffer, and that's what we > > use for IO. If fsverity needs a page based scatter/gather list > > for hardware offload, it could ask the filesystem to provide it > > for that given buffer... > > > > > BTW, converting fs/verity/ from ahash to shash is an option; I've really never > > > been a fan of the scatterlist-based crypto APIs! The disadvantage of doing > > > this, though, would be that it would remove support for all the hardware crypto > > > drivers. > > > > > > That *might* actually be okay, as that approach to crypto acceleration > > > has mostly fallen out of favor, in favor of CPU-based acceleration. But I do > > > worry about e.g. someone coming out of the woodwork and saying they need to use > > > fsverity on a low-powered ARM board that has a crypto accelerator like CAAM, and > > > they MUST use their crypto accelerator to get acceptable performance. > > > > True, but we are very unlikely to be using XFS on such small > > systems and I don't think we really care about XFS performance on > > android sized systems, either. > > > > FYI, I've sent an RFC patch that converts fs/verity/ from ahash to shash: > https://lore.kernel.org/r/20230406003714.94580-1-ebiggers at kernel.org > > It would be great if we could do that. But I need to get a better sense for > whether anyone will complain... FWIW, dm-verity went in the other direction. It started with shash, and then in 2017 it was switched to ahash by https://git.kernel.org/linus/d1ac3ff008fb9a48 ("dm verity: switch to using asynchronous hash crypto API"). I think that was part of my motivation for using ahash in fsverity from the beginning. Still, it does seem that ahash is more trouble than it's worth these days... - Eric