Re: [RFC PATCH v2 01/18] mm: free PG_rcu_free folios only after an RCU grace period
From: David Hildenbrand (Arm)
Date: Thu Nov 12 2026 - 07:52:40 EST
On 11/12/26 13:26, Kiryl Shutsemau wrote:
> On Wed, Nov 11, 2026 at 11:03:38AM +0100, David Hildenbrand (Arm) wrote:
>> So I might be completely off, but what I imagine is that the memdescs will get
>> RCU-freed (these are not pages), and once they are then getting freed, they will
>> probably take the physical page with them.
>>
>> And freeing memdescs through RCU will likely be memdesc specific.
>>
>> I really don't know, Willy might know more about these plans.
>
> Right: once the folio is allocated separately, the lockless read
> dereferences it too, so it has to wait for the grace period along with
> its pages. The per-CPU batching and the waits in the allocator later
> in the series do not depend on where the check sits.
>
> Until then the folio is the struct page, and __free_pages_prepare() is
> the one place every page cache folio passes, so v3 keeps the check
> there.
If we go that way, don't make it effectively folio-centric in the
implementation. That's what triggered my response in the first place.
--
Cheers,
David