Re: [RFC PATCH 01/12] rcu_txn: Add single-writer RCU pseudo-transactions

From: Mathieu Desnoyers

Date: Tue Nov 10 2026 - 13:06:15 EST


On 2026-10-23 14:22, Puranjay Mohan wrote:
[...]
This isn't quite true on !PREEMPT_RT. As far as lockdep is concerned,
kfree() can't be called under a raw_spinlock_t on any kernel: once the
per-CPU sheaf is full, SLUB takes barn->lock, a spinlock_t, and
PROVE_RAW_LOCK_NESTING flags that whether or not PREEMPT_RT is set.

You are right. Thanks for tracking it down to barn->lock.

[...]
The cost is a grace period of delay before freeing descriptors that
never installed a proxy. I'd take that over a wait-type override
around the !PREEMPT_RT kfree(), since it also removes the RT/!RT split.

Agreed. The next version will free every heap descriptor with
kfree_rcu(). This includes the old descriptor that a grow replaces. A
grow can run with GFP_ATOMIC under a raw spinlock too.

The descriptors of the per-CPU pool, which the list operations will
use, never go back to the slab allocator. One that installed no proxy
returns to its pool at once, without the grace period.

Updating the comments and commit messages you listed is planned too.
The atomic-context test (patch 10) will reproduce your splat when
kfree() is put back. See my reply there.

Thanks,

Mathieu


--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com