From: Anton Ivanov <[email protected]> Weak may fail for reasons unrelated to the comparison (not on x86, where these are practically equivalent).
Thus, it can and should be used only in cases where there will be a repeat of the event which runs the code (in this case semaphore post). On non-x86 architectures using weak may result in a failed comparison without any more sem post events - a hang. Reported for arm, likely for other platforms where weak may fail. Reported-by: [email protected] Signed-off-by: Anton Ivanov <[email protected]> --- lib/ovn-parallel-hmap.c | 2 +- ovs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ovn-parallel-hmap.c b/lib/ovn-parallel-hmap.c index b8c7ac786..56ceed8e8 100644 --- a/lib/ovn-parallel-hmap.c +++ b/lib/ovn-parallel-hmap.c @@ -267,7 +267,7 @@ ovn_run_pool_callback(struct worker_pool *pool, * (most likely acq_rel) to ensure that the main thread * sees all of the results produced by the worker. */ - if (atomic_compare_exchange_weak( + if (atomic_compare_exchange_strong( &pool->controls[index].finished, &test, false)) { -- 2.20.1 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
