Searched hist:"0 b27f39171c4614c40985f438e9b5f24f33d3e79" (Results 1 – 1 of 1) sorted by relevance
/kvm-unit-tests/lib/ |
H A D | on-cpus.c | 0b27f39171c4614c40985f438e9b5f24f33d3e79 Thu Oct 31 12:39:50 UTC 2024 Andrew Jones <andrew.jones@linux.dev> 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 018550041b38 ("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: 018550041b38 ("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>
|