[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wjgm=xTvbu4zEn3kFRC8bF8XXrOdK5fZj8iNbDn5bGB2g@mail.gmail.com>
Date: Mon, 27 Oct 2025 09:48:57 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: David Hildenbrand <david@...hat.com>
Cc: Hugh Dickins <hughd@...gle.com>, Kiryl Shutsemau <kirill@...temov.name>,
Andrew Morton <akpm@...ux-foundation.org>, Matthew Wilcox <willy@...radead.org>,
Alexander Viro <viro@...iv.linux.org.uk>, Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
Yang Shi <shy828301@...il.com>, Dave Chinner <david@...morbit.com>,
Suren Baghdasaryan <surenb@...gle.com>, linux-mm@...ck.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/filemap: Implement fast short reads
On Mon, 27 Oct 2025 at 09:06, David Hildenbrand <david@...hat.com> wrote:
>
> So I really wish that we can defer optimizing this to freeing folios
> under RCU instead.
So just to see, I dug around when we started to do the rcu-protected
folio lookup (well, it was obviously not a folio at the time).
Mainly because we actually had a lot more of those subtle
folio_try_get() users than I expected us to have,
It goes back to July 2008 (commit e286781d5f2e: "mm: speculative page
references" being the first in the series).
I do have to say that the original naming was better: we used to call
the "try_get" operation "page_cache_get_speculative()", which made it
very clear that it was doing something speculative and different from
some of our other rcu patterns, where if it's successful it's all
good.
Because even when successful, the folio in folio_try_get() is still
speculative and needs checking.
Not all of our current users seem to re-verify the source of the folio
afterwards (deferred_split_scan() makes me go "Uhh - you seem to rely
on folio_try_get() as some kind of validity check" for example).
Oh well. This is all entirely unrelated to the suggested patch, just
musings from me looking at that other code that I think is a lot more
subtle and people don't seem to have issues with.
Linus
Powered by blists - more mailing lists