Unverified Commit b72e591f authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Christian Brauner
Browse files

fs/buffer: remove batching from async read



block_read_full_folio() currently puts all !uptodate buffers into
an array allocated on the stack, then iterates over it twice, first
locking the buffers and then submitting them for read.  We want to
remove this array because it occupies too much stack space on
configurations with a larger PAGE_SIZE (eg 512 bytes with 8 byte
pointers and a 64KiB PAGE_SIZE).

We cannot simply submit buffer heads as we find them as the completion
handler needs to be able to tell when all reads are finished, so it can
end the folio read.  So we keep one buffer in reserve (using the 'prev'
variable) until the end of the function.

Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatar"Matthew Wilcox (Oracle)" <willy@infradead.org>
Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20250221223823.1680616-3-mcgrof@kernel.org


Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 753aadeb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment