Re: Improve page refcount scalability

From: Linus Torvalds

Date: Wed Oct 14 2026 - 13:16:14 EST


On Wed, 14 Oct 2026 at 09:59, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> That actually makes me think I should go back and clear PG_rcu_free on
> unlink - at that point the folio can no longer be read. I used to
> treat unlink differently from truncate/hole punch because of this [..]

>From a quick read, that worked exactly _because_ the marking was done
at folio removal time, and then it was easy to just say "if the folio
was removed because of a unlink, don't bother marking it for RCU
delay, because there can be no RCU readers any more".

But now that we mark it at read time, actively clearing the bit at
unlink time looks a lot more iffy.

Not worth the pain unless somebody actually hits this as an issue.
Right now it feels to me like a "numbers go up" kind of thing rather
than a problem.

Linus