Skip to content
Commit c97299f1 authored by Xiaoguang Xing's avatar Xiaoguang Xing
Browse files

riscv: include: Add smp_cond_load_acquire()



Fix qspinlock issue that loops to call cpu_relax and not exit.
The call trace is:
queued_spin_lock_slowpath->arch_mcs_spin_lock_contended
->smp_cond_load_acquire.

RISCV has not defined smp_cond_load_acquire, so it uses generic
funtion that defined in include/asm-generic/barrier.h.
The generic smp_cond_load_acquire calls smp_cond_load_relaxed that
loops to call READ_ONCE and cpu_relax.
The READ_ONCE need barrier after it to get the new value.

Signed-off-by: default avatarXiaoguang Xing <xiaoguang.xing@sophgo.com>
parent 3404af04
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment