diff options
author | Zqiang <qiang1.zhang@intel.com> | 2022-06-12 10:02:25 +0800 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2022-06-21 15:57:04 -0700 |
commit | 7bf336fb8dac718febb7bf4fe79e1be0c5e4a631 (patch) | |
tree | fe467e138cf5fe06b9a667a436909dfcdc538d74 /kernel/sched/idle.c | |
parent | 1a5ca5e09811dec9472f50b98eeb3e3b2442d050 (diff) | |
download | linux-7bf336fb8dac718febb7bf4fe79e1be0c5e4a631.tar.gz |
refscale: Convert test_lock spinlock to raw_spinlock
In kernels built with CONFIG_PREEMPT_RT=y, spinlocks are replaced by
rt_mutex, which can sleep. This means that acquiring a non-raw spinlock
in a critical section where preemption is disabled can trigger the
following BUG:
BUG: scheduling while atomic: ref_scale_reade/76/0x00000002
Preemption disabled at:
ref_lock_section+0x16/0x80
Call Trace:
<TASK>
dump_stack_lvl+0x5b/0x82
dump_stack+0x10/0x12
__schedule_bug.cold+0x9c/0xad
__schedule+0x839/0xc00
schedule_rtlock+0x22/0x40
rtlock_slowlock_locked+0x460/0x1350
rt_spin_lock+0x61/0xe0
ref_lock_section+0x29/0x80
rcu_scale_one_reader+0x52/0x60
ref_scale_reader+0x28d/0x490
kthread+0x128/0x150
ret_from_fork+0x22/0x30
</TASK>
This commit therefore converts spinlock to raw_spinlock.
Signed-off-by: Zqiang <qiang1.zhang@intel.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'kernel/sched/idle.c')
0 files changed, 0 insertions, 0 deletions