Re: Improve page refcount scalability

From: Matthew Wilcox

Date: Wed Oct 14 2026 - 11:32:30 EST


On Wed, Oct 14, 2026 at 12:53:11PM +0100, Kiryl Shutsemau wrote:
> The uptodate check in filemap_read_rcu_can_copy() has to stay, though.
> The flag only says the folio was uptodate when it was marked. Some
> filesystems clear PG_uptodate on a folio that stays in the page cache,
> and that can happen after the folio got the flag.

Those filesystems are buggy. We have assertions that the uptodate flag
is set on folios mapped into userspace, and filesystems going arund
clearing the uptodate bit will cause problems. It's something I'm
working on removing, but since it's all connected to writeback errors,
it takes a lot of arguing with each filesystem maintainer.