Re: [RFC PATCH 10/12] rcu_txn: Test a commit from atomic context
From: Mathieu Desnoyers
Date: Tue Nov 10 2026 - 10:23:56 EST
On 2026-10-23 14:22, Puranjay Mohan wrote:
[...]
This matters on !PREEMPT_RT too: there, a one-record commit or a cancel
under a raw spinlock calls kfree(), which lockdep can flag (see my reply
to patch 1). The test can't catch that as written.
Agreed. The next version will fix the free in patch 1, and this test
will catch it.
[...]
Running the one-record and cancel cases under raw_spin_lock_irqsave() in
a loop would catch it.
My first try reserved and committed one handle at a time. It did not
catch it: each kfree() gave back the object that the reserve had just
taken, so the sheaf never filled. As in your reproducer, the next
version reserves 4096 one-record handles first. Then it commits them
all under one raw spinlock, and does the same for cancels. On x86_64,
this gives your barn->lock splat with kfree() put back, and passes with
kfree_rcu().
[...]
A kunit_skip() when PROVE_RAW_LOCK_NESTING is off, or
debug_locks is already 0, or TAINT_WARN is already set, would make that
visible.
Planned for the next version, with these three conditions.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com