lib/on-cpus: Correct and simplify synchronization
get/put_on_cpu_info() were providing per-cpu locking for the per-cpu on_cpu info, but it's difficult to reason that they're correct since they use test_and_set/clear rather than a typical lock. Just revert to a typical spinlock to simplify it. Also simplify the break case for on_cpu_async() - we don't care if func is NULL, we only care that the cpu is idle. And, finally, add a missing barrier to on_cpu_async(). Before commit 01855004 ("arm/arm64: Remove spinlocks from on_cpu_async") the spin_unlock() provided an implicit barrier at the correct location, but moving the release to the more logical location, below the setting of idle, lost it. Fixes: 01855004 ("arm/arm64: Remove spinlocks from on_cpu_async") Reviewed-by:Eric Auger <eric.auger@redhat.com> Signed-off-by:
Andrew Jones <andrew.jones@linux.dev>
Loading
Please register or sign in to comment