Re: [PATCH 10/26] netfs: Bulk load the readahead-provided folios up front

From: Paulo Alcantara

Date: Sat Mar 28 2026 - 14:36:57 EST


David Howells <dhowells@xxxxxxxxxx> writes:

> Load all the folios by the VM for readahead up front into the folio queue.
> With the number of folios provided by the VM, the folio queue can be fully
> allocated first and then the loading happen in one go inside the RCU read
> lock. The folio refs acquired from readahead are dropped in bulk once the
> first subrequest is dispatched as it's quite a slow operation.
>
> This simplifies the buffer handling later and isn't noticeably slower as
> the xarray doesn't need to be modified and the folios are all already
> pre-locked.
>
> Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
> cc: Paulo Alcantara <pc@xxxxxxxxxxxxx>
> cc: Matthew Wilcox <willy@xxxxxxxxxxxxx>
> cc: netfs@xxxxxxxxxxxxxxx
> cc: linux-mm@xxxxxxxxx
> cc: linux-fsdevel@xxxxxxxxxxxxxxx
> ---
> fs/netfs/buffered_read.c | 95 +++++++++++++++++++++-------------
> fs/netfs/rolling_buffer.c | 75 +++++++++++++++++++++++++++
> include/linux/netfs.h | 1 +
> include/linux/rolling_buffer.h | 3 ++
> include/trace/events/netfs.h | 1 +
> 5 files changed, 138 insertions(+), 37 deletions(-)

Reviewed-by: Paulo Alcantara (Red Hat) <pc@xxxxxxxxxxxxx>