]> www.infradead.org Git - users/jedix/linux-maple.git/commit
fs/buffer: remove batching from async read
authorMatthew Wilcox <willy@infradead.org>
Fri, 21 Feb 2025 22:38:17 +0000 (14:38 -0800)
committerChristian Brauner <brauner@kernel.org>
Mon, 24 Feb 2025 10:44:43 +0000 (11:44 +0100)
commitb72e591f74de5b5c80963f399d44f485dfc86610
treed3777985793a44d2ea1bfffb1d2fa61c7941b9f0
parent753aadebf2e307ec37ea992f1dd3b94291f9954f
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: Hannes Reinecke <hare@suse.de>
Signed-off-by: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20250221223823.1680616-3-mcgrof@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/buffer.c