fs: reduce stack usage in __mpage_writepage
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 15 Dec 2023 20:02:34 +0000 (20:02 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 29 Dec 2023 19:58:33 +0000 (11:58 -0800)
commit6ad7c607b125ce02bd0870f490d990aee8609070
treec4cb49f7e07ec78d1eb3dfa776ffe1ab7a105a63
parente8ff8248d37718da1a678648a4485b76f64b9d29
fs: reduce stack usage in __mpage_writepage

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-4-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