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

Paulo Alcantara
2026-03-28T18:36:31Z

David Howells <dhowells@redhat.com> 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@redhat.com>
> cc: Paulo Alcantara <pc@manguebit.org>
> cc: Matthew Wilcox <willy@infradead.org>
> cc: netfs@lists.linux.dev
> cc: linux-mm@kvack.org
> cc: linux-fsdevel@vger.kernel.org
> ---
> 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@manguebit.org>