Re: [PATCH 1/1] mm/readahead: simplify page_cache_ra_unbounded loop counter reset
From: Frederick Mayle
Date: Thu May 07 2026 - 22:04:20 EST
On Fri, May 1, 2026 at 6:11 AM Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> On Thu, 30 Apr 2026 18:19:07 -0700 Frederick Mayle <fmayle@xxxxxxxxxx> wrote:
>
> > Minor cleanup, no behavior change intended.
> >
> > `read_pages` ensures that `ractl->_nr_pages` is zero before it returns,
>
> So it seems, but depending upon this might be a bit fragile?
>
> It would be better to make this a more explicit/formal part of the
> read_pages() contract. kerneldocifying read_pages() would be a
> suitable way.
I agree. I've sent the following patch to document the invariant
https://lore.kernel.org/r/20260508015402.735441-1-fmayle@xxxxxxxxxx/