On Thu, Sep 03, 2020 at 12:22:18PM -0700, Andrew Morton wrote: > On Thu, 3 Sep 2020 15:08:38 +0100 "Matthew Wilcox (Oracle)" <willy@xxxxxxxxxxxxx> wrote: > > > Define it in the callers instead of in page_cache_ra_unbounded(). > > > > The changelogs for patches 2-9 are explaining what the patches do, but > not why they do it, Presumably there's some grand scheme in mind, but > it isn't being revealed to the reader! Sorry! For both pieces of infrastructure being build on top of this patchset, we want the ractl to be available higher in the call-stack. For David's work, he wants to add the 'critical page' to the ractl so that he knows which page NEEDS to be brought in from storage, and which ones are nice-to-have. We might want something similar in block storage too. It used to be simple -- the first page was the critical one, but then mmap added fault-around and so for that usecase, the middle page is the critical one. Anyway, I don't have any code to show that yet, we just know that the lowest point in the callchain where we have that information is do_sync_mmap_readahead() and so the ractl needs to start its life there. For THP, I can show you the code that needs it. It's actually the apex patch to the series; the one which finally starts to allocate THPs and present them to consenting filesystems: http://git.infradead.org/users/willy/pagecache.git/commitdiff/798bcf30ab2eff278caad03a9edca74d2f8ae760 This doesn't need the ractl to be available as high in the stack as David does, which is why he did the last few patches.