diff options
| author | Paul E. McKenney <paulmck@kernel.org> | 2026-03-21 06:29:20 +0300 |
|---|---|---|
| committer | Boqun Feng <boqun@kernel.org> | 2026-03-25 18:59:02 +0300 |
| commit | 61bbcfb50514a8a94e035a7349697a3790ab4783 (patch) | |
| tree | 007c6b3cb9f770c1aa032fcb57c0a1d77d40b6a5 /samples/workqueue | |
| parent | 175b45ed343a9c547b5f45293d3ea08d38a7b6f4 (diff) | |
| download | linux-61bbcfb50514a8a94e035a7349697a3790ab4783.tar.xz | |
srcu: Push srcu_node allocation to GP when non-preemptible
When the srcutree.convert_to_big and srcutree.big_cpu_lim kernel boot
parameters specify initialization-time allocation of the srcu_node
tree for statically allocated srcu_struct structures (for example, in
DEFINE_SRCU() at build time instead of init_srcu_struct() at runtime),
init_srcu_struct_nodes() will attempt to dynamically allocate this tree
at the first run-time update-side use of this srcu_struct structure,
but while holding a raw spinlock. Because the memory allocator can
acquire non-raw spinlocks, this can result in lockdep splats.
This commit therefore uses the same SRCU_SIZE_ALLOC trick that is used
when the first run-time update-side use of this srcu_struct structure
happens before srcu_init() is called. The actual allocation then takes
place from workqueue context at the ends of upcoming SRCU grace periods.
[boqun: Adjust the sha1 of the Fixes tag]
Fixes: 175b45ed343a ("srcu: Use raw spinlocks so call_srcu() can be used under preempt_disable()")
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Boqun Feng <boqun@kernel.org>
Diffstat (limited to 'samples/workqueue')
0 files changed, 0 insertions, 0 deletions
