Re: [RFC PATCH v2 01/18] mm: free PG_rcu_free folios only after an RCU grace period
From: Linus Torvalds
Date: Mon Nov 09 2026 - 11:14:04 EST
On Mon, 9 Nov 2026 at 06:43, David Hildenbrand (Arm) <david@xxxxxxxxxx> wrote:
>
> Can we just rework that code first to have some clear folio freeing path, IOW
> doing this in a folio-specific helper?
I think you're making things worse rather than better.
The whole point was to hook into *one* place: the page freeing.
Trying to make it specific to one special freeing path only makes it
fragile and less obvious, and results in anybody who then uses some
other freeing model to miss the RCU thing.
It also means that suddenly nobody else can use the RCU path for their own uses.
Look at all the kmalloc RCU freeing: it's used all over the place. RCU
has basically taken over the kernel. Every single performance-critical
lock-free area of the kernel wants RCU freeing.
I think trying to corral it into some special case is the last thing
we want to do. It only makes things less potentially useful and more
fragile.
Linus