This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via c2ed3f71a8d61449c5e35ce201f020a74a8ea244 (commit) from cbb7f52e28d2e1c20c8eac662aa6135242d072e8 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit c2ed3f71a8d61449c5e35ce201f020a74a8ea244 Author: Brian Brooks brian.brooks@arm.com Date: Sat Aug 26 00:40:08 2017 -0500
linux-gen: barrier: Use correct memory ordering
Memory accesses that happen-before, in program order, a call to odp_barrier_wait() cannot be reordered to after the call. Similarly, memory accesses that happen-after, in program order, a call to odp_barrier_wait() cannot be reordered to before the call.
The current implementation of barriers uses sequentially consistent fences on either side of odp_barrier_wait().
The correct memory ordering for barriers is release upon entering odp_barrier_wait(), to prevent reordering to after the barrier, and acquire upon exiting odp_barrier_wait(), to prevent reordering to before the barrier.
The measurable performance difference is negligible on weakly ordered architectures such as ARM, so the highlight of this change is correctness.
Signed-off-by: Brian Brooks brian.brooks@arm.com Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/odp_barrier.c b/platform/linux-generic/odp_barrier.c index 5eb354de..f70bdbf8 100644 --- a/platform/linux-generic/odp_barrier.c +++ b/platform/linux-generic/odp_barrier.c @@ -34,7 +34,7 @@ void odp_barrier_wait(odp_barrier_t *barrier) uint32_t count; int wasless;
- odp_mb_full(); + odp_mb_release();
count = odp_atomic_fetch_inc_u32(&barrier->bar); wasless = count < barrier->count; @@ -48,5 +48,5 @@ void odp_barrier_wait(odp_barrier_t *barrier) odp_cpu_pause(); }
- odp_mb_full(); + odp_mb_acquire(); }
-----------------------------------------------------------------------
Summary of changes: platform/linux-generic/odp_barrier.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hooks/post-receive