Thread (13 messages) 13 messages, 3 authors, 2020-10-27

Re: [PATCH 3/6] fs: Convert block_read_full_page to be synchronous

From: Matthew Wilcox <willy@infradead.org>
Date: 2020-10-23 20:42:18
Also in: linux-fscrypt, linux-fsdevel, lkml

On Fri, Oct 23, 2020 at 09:13:35AM -0700, Eric Biggers wrote:
On Fri, Oct 23, 2020 at 02:21:38PM +0100, Matthew Wilcox wrote:
quoted
I wonder about allocating bios that can accommodate more bvecs.  Not sure
how often filesystems have adjacent blocks which go into non-adjacent
sub-page blocks.  It's certainly possible that a filesystem might have
a page consisting of DDhhDDDD ('D' for Data, 'h' for hole), but how
likely is it to have written the two data chunks next to each other?
Maybe with O_SYNC?
I think that's a rare case that's not very important to optimize.  And there's
already a lot of code where filesystems *could* submit a single bio in that case
but don't.  For example, both fs/direct-io.c and fs/iomap/direct-io.c only
submit bios that contain logically contiguous data.
True.  iomap/buffered-io.c will do it though.
If you do implement this optimization, note that it wouldn't work when a
bio_crypt_ctx is set, since the data must be logically contiguous in that case.
To handle that you'd need to call fscrypt_mergeable_bio_bh() when adding each
block, and submit the bio if it returns false.  (In contrast, with your current
proposal, calling fscrypt_mergeable_bio_bh() isn't necessary because each bio
only contains logically contiguous data within one page.)
Oh, that's disappointing.  I had assumed that you'd set up the dun for
the logical block corresponding to the start of the page and then you'd
be able to decrypt any range in the page.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help