fs: reduce stack usage in do_mpage_readpage
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 15 Dec 2023 20:02:35 +0000 (20:02 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 29 Dec 2023 19:58:33 +0000 (11:58 -0800)
commit12ac5a65cb5612e938abdd58c2dcc9cdc80b6101
treea3de81140b8a51a0283d9e9fde0476988fb17c5f
parent6ad7c607b125ce02bd0870f490d990aee8609070
fs: reduce stack usage in do_mpage_readpage

Some architectures support a very large PAGE_SIZE, so instead of the 8
pointers we see with a 4kB PAGE_SIZE, we can see 128 pointers with 64kB or
so many on Hexagon that it trips compiler warnings about exceeding stack
frame size.

All we're doing with this array is checking for block contiguity, which we
can as well do by remembering the address of the first block in the page
and checking this block is at the appropriate offset from that address.

Link: https://lkml.kernel.org/r/20231215200245.748418-5-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/mpage.c