From 5e13f02631072e958b573a791a131d32d567a371 Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Mon, 25 Jan 2021 09:00:14 -0700 Subject: [PATCH] opal: enable load-linked, store-conditional atomics for AArch64 This PR updates the opal atomic code to allow the use of the AArch64 LL/SC instructions even when C11 atomics are enabled. This should provide for better atomic lifo/fifo performance on these systems. Performance on Apple Silicon (Late 2021 Mac Mini M1, 16GB): LL/SC: ``` Mac-mini:class hjelmn$ ./opal_lifo -t 1 Single thread test. Time: 0 s 13621 us 13 nsec/poppush Atomics thread finished. Time: 0 s 14375 us 14 nsec/poppush Atomics thread finished. Time: 0 s 154525 us 154 nsec/poppush Atomics thread finished. Time: 0 s 154661 us 154 nsec/poppush Atomics thread finished. Time: 0 s 156505 us 156 nsec/poppush Atomics thread finished. Time: 0 s 157013 us 157 nsec/poppush Atomics thread finished. Time: 0 s 157493 us 157 nsec/poppush Atomics thread finished. Time: 0 s 158275 us 158 nsec/poppush Atomics thread finished. Time: 0 s 158647 us 158 nsec/poppush Atomics thread finished. Time: 0 s 158973 us 158 nsec/poppush All threads finished. Thread count: 8 Time: 0 s 159023 us 19 nsec/poppush SUPPORT: OMPI Test Passed: opal_lifo_t: (7 tests) ``` ``` Mac-mini:class hjelmn$ ./opal_fifo Single thread test. Time: 0 s 7620 us 7 nsec/poppush Atomics thread finished. Time: 0 s 7918 us 7 nsec/poppush Atomics thread finished. Time: 0 s 76081 us 76 nsec/poppush Atomics thread finished. Time: 0 s 79458 us 79 nsec/poppush Atomics thread finished. Time: 0 s 84994 us 84 nsec/poppush Atomics thread finished. Time: 0 s 90103 us 90 nsec/poppush Atomics thread finished. Time: 0 s 90403 us 90 nsec/poppush Atomics thread finished. Time: 0 s 91280 us 91 nsec/poppush Atomics thread finished. Time: 0 s 92466 us 92 nsec/poppush Atomics thread finished. Time: 0 s 93835 us 93 nsec/poppush All threads finished. Thread count: 8 Time: 0 s 93916 us 11 nsec/poppush Exhaustive atomics thread finished. Popped 821530 items. Time: 0 s 107912 us 131 nsec/poppush Exhaustive atomics thread finished. Popped 810445 items. Time: 0 s 114695 us 141 nsec/poppush Exhaustive atomics thread finished. Popped 806449 items. Time: 0 s 116241 us 144 nsec/poppush Exhaustive atomics thread finished. Popped 813960 items. Time: 0 s 117182 us 143 nsec/poppush Exhaustive atomics thread finished. Popped 825230 items. Time: 0 s 118810 us 143 nsec/poppush Exhaustive atomics thread finished. Popped 826685 items. Time: 0 s 119486 us 144 nsec/poppush Exhaustive atomics thread finished. Popped 828373 items. Time: 0 s 120327 us 145 nsec/poppush Exhaustive atomics thread finished. Popped 830266 items. Time: 0 s 121114 us 145 nsec/poppush All threads finished. Thread count: 8 Time: 0 s 121186 us 15 nsec/poppush SUPPORT: OMPI Test Passed: opal_fifo_t: (8 tests) ``` CAS128: ``` Mac-mini:class hjelmn$ ./opal_lifo -t 1 Single thread test. Time: 0 s 25688 us 25 nsec/poppush Atomics thread finished. Time: 0 s 29322 us 29 nsec/poppush Atomics thread finished. Time: 4 s 57595 us 4057 nsec/poppush Atomics thread finished. Time: 4 s 151568 us 4151 nsec/poppush Atomics thread finished. Time: 4 s 162332 us 4162 nsec/poppush Atomics thread finished. Time: 4 s 173651 us 4173 nsec/poppush Atomics thread finished. Time: 4 s 176088 us 4176 nsec/poppush Atomics thread finished. Time: 4 s 178025 us 4178 nsec/poppush Atomics thread finished. Time: 4 s 178713 us 4178 nsec/poppush Atomics thread finished. Time: 4 s 178760 us 4178 nsec/poppush All threads finished. Thread count: 8 Time: 4 s 178830 us 522 nsec/poppush SUPPORT: OMPI Test Passed: opal_lifo_t: (7 tests) ``` ``` Mac-mini:class hjelmn$ ./opal_fifo Single thread test. Time: 0 s 7611 us 7 nsec/poppush Atomics thread finished. Time: 0 s 19256 us 19 nsec/poppush Atomics thread finished. Time: 2 s 555095 us 2555 nsec/poppush Atomics thread finished. Time: 2 s 562521 us 2562 nsec/poppush Atomics thread finished. Time: 2 s 570284 us 2570 nsec/poppush Atomics thread finished. Time: 2 s 570760 us 2570 nsec/poppush Atomics thread finished. Time: 2 s 571438 us 2571 nsec/poppush Atomics thread finished. Time: 2 s 573642 us 2573 nsec/poppush Atomics thread finished. Time: 2 s 575019 us 2575 nsec/poppush Atomics thread finished. Time: 2 s 575161 us 2575 nsec/poppush All threads finished. Thread count: 8 Time: 2 s 575231 us 321 nsec/poppush Exhaustive atomics thread finished. Popped 639525 items. Time: 1 s 828167 us 2858 nsec/poppush Exhaustive atomics thread finished. Popped 642578 items. Time: 1 s 840312 us 2863 nsec/poppush Exhaustive atomics thread finished. Popped 641617 items. Time: 1 s 846852 us 2878 nsec/poppush Exhaustive atomics thread finished. Popped 639283 items. Time: 1 s 849705 us 2893 nsec/poppush Exhaustive atomics thread finished. Popped 646423 items. Time: 1 s 851183 us 2863 nsec/poppush Exhaustive atomics thread finished. Popped 645146 items. Time: 1 s 851750 us 2870 nsec/poppush Exhaustive atomics thread finished. Popped 645428 items. Time: 1 s 852076 us 2869 nsec/poppush Exhaustive atomics thread finished. Popped 648267 items. Time: 1 s 852240 us 2857 nsec/poppush All threads finished. Thread count: 8 Time: 1 s 852359 us 231 nsec/poppush SUPPORT: OMPI Test Passed: opal_fifo_t: (8 tests) ``` About a 40x performance with the multi-threaded lifo/fifo tests. These are artificial benchmarks but give a reasonable idea of how these structures perform under heavy contention. Signed-off-by: Nathan Hjelm --- opal/class/opal_fifo.h | 4 +- opal/class/opal_lifo.h | 8 +- opal/include/opal/sys/arm64/Makefile.am | 3 + opal/include/opal/sys/arm64/atomic.h | 58 +------------- opal/include/opal/sys/arm64/atomic_llsc.h | 92 +++++++++++++++++++++++ opal/include/opal/sys/atomic.h | 54 +++++++++++-- opal/include/opal/sys/atomic_impl.h | 20 ----- opal/include/opal/sys/atomic_stdc.h | 4 - test/class/opal_fifo.c | 4 +- test/class/opal_lifo.c | 2 +- 10 files changed, 158 insertions(+), 91 deletions(-) create mode 100644 opal/include/opal/sys/arm64/atomic_llsc.h diff --git a/opal/class/opal_fifo.h b/opal/class/opal_fifo.h index 89b90329383..3cc88393cd1 100644 --- a/opal/class/opal_fifo.h +++ b/opal/class/opal_fifo.h @@ -14,6 +14,8 @@ * Copyright (c) 2010 IBM Corporation. All rights reserved. * Copyright (c) 2014-2018 Los Alamos National Security, LLC. All rights * reseved. + * Copyright (c) 2021 Triad National Security, LLC. All rights reserved. + * Copyright (c) 2021 Google, LLC. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -76,7 +78,7 @@ static inline bool opal_fifo_is_empty( opal_fifo_t* fifo ) return opal_fifo_head (fifo) == &fifo->opal_fifo_ghost; } -#if OPAL_HAVE_ATOMIC_COMPARE_EXCHANGE_128 +#if OPAL_HAVE_ATOMIC_COMPARE_EXCHANGE_128 && !OPAL_HAVE_ATOMIC_LLSC_PTR /* Add one element to the FIFO. We will return the last head of the list * to allow the upper level to detect if this element is the first one in the diff --git a/opal/class/opal_lifo.h b/opal/class/opal_lifo.h index 99b90be10a2..4c34fbe5f5c 100644 --- a/opal/class/opal_lifo.h +++ b/opal/class/opal_lifo.h @@ -16,6 +16,8 @@ * reseved. * Copyright (c) 2016-2018 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2021 Triad National Security, LLC. All rights reserved. + * Copyright (c) 2021 Google, LLC. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -50,7 +52,7 @@ union opal_counted_pointer_t { /** list item pointer */ volatile opal_atomic_intptr_t item; } data; -#if OPAL_HAVE_ATOMIC_COMPARE_EXCHANGE_128 && HAVE_OPAL_INT128_T +#if OPAL_HAVE_ATOMIC_COMPARE_EXCHANGE_128 && HAVE_OPAL_INT128_T && !OPAL_HAVE_ATOMIC_LLSC_PTR /** used for atomics when there is a cmpset that can operate on * two 64-bit values */ opal_atomic_int128_t atomic_value; @@ -60,7 +62,7 @@ union opal_counted_pointer_t { typedef union opal_counted_pointer_t opal_counted_pointer_t; -#if OPAL_HAVE_ATOMIC_COMPARE_EXCHANGE_128 +#if OPAL_HAVE_ATOMIC_COMPARE_EXCHANGE_128 && !OPAL_HAVE_ATOMIC_LLSC_PTR /* Add one element to the FIFO. We will return the last head of the list * to allow the upper level to detect if this element is the first one in the @@ -136,7 +138,7 @@ static inline bool opal_lifo_is_empty( opal_lifo_t* lifo ) } -#if OPAL_HAVE_ATOMIC_COMPARE_EXCHANGE_128 +#if OPAL_HAVE_ATOMIC_COMPARE_EXCHANGE_128 && !OPAL_HAVE_ATOMIC_LLSC_PTR /* Add one element to the LIFO. We will return the last head of the list * to allow the upper level to detect if this element is the first one in the diff --git a/opal/include/opal/sys/arm64/Makefile.am b/opal/include/opal/sys/arm64/Makefile.am index 33db6ecb014..33468ac1887 100644 --- a/opal/include/opal/sys/arm64/Makefile.am +++ b/opal/include/opal/sys/arm64/Makefile.am @@ -9,6 +9,8 @@ # University of Stuttgart. All rights reserved. # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. +# Copyright (c) 2021 Triad National Security, LLC. All rights reserved. +# Copyright (c) 2021 Google, LLC. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -20,5 +22,6 @@ headers += \ opal/sys/arm64/atomic.h \ + opal/sys/arm64/atomic_llsc.h \ opal/sys/arm64/timer.h diff --git a/opal/include/opal/sys/arm64/atomic.h b/opal/include/opal/sys/arm64/atomic.h index 76409623b16..8495901ace1 100644 --- a/opal/include/opal/sys/arm64/atomic.h +++ b/opal/include/opal/sys/arm64/atomic.h @@ -14,6 +14,8 @@ * Copyright (c) 2010 ARM ltd. All rights reserved. * Copyright (c) 2016-2018 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2021 Triad National Security, LLC. All rights reserved. + * Copyright (c) 2021 Google, LLC. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -21,6 +23,8 @@ * $HEADER$ */ +#include "atomic_llsc.h" + #if !defined(OPAL_SYS_ARCH_ATOMIC_H) #define OPAL_SYS_ARCH_ATOMIC_H 1 @@ -28,13 +32,11 @@ #if OPAL_GCC_INLINE_ASSEMBLY #define OPAL_HAVE_ATOMIC_MEM_BARRIER 1 -#define OPAL_HAVE_ATOMIC_LLSC_32 1 #define OPAL_HAVE_ATOMIC_COMPARE_EXCHANGE_32 1 #define OPAL_HAVE_ATOMIC_SWAP_32 1 #define OPAL_HAVE_ATOMIC_MATH_32 1 #define OPAL_HAVE_ATOMIC_COMPARE_EXCHANGE_64 1 #define OPAL_HAVE_ATOMIC_SWAP_64 1 -#define OPAL_HAVE_ATOMIC_LLSC_64 1 #define OPAL_HAVE_ATOMIC_ADD_32 1 #define OPAL_HAVE_ATOMIC_AND_32 1 #define OPAL_HAVE_ATOMIC_OR_32 1 @@ -162,32 +164,6 @@ static inline bool opal_atomic_compare_exchange_strong_rel_32 (opal_atomic_int32 return ret; } -#define opal_atomic_ll_32(addr, ret) \ - do { \ - opal_atomic_int32_t *_addr = (addr); \ - int32_t _ret; \ - \ - __asm__ __volatile__ ("ldaxr %w0, [%1] \n" \ - : "=&r" (_ret) \ - : "r" (_addr)); \ - \ - ret = (typeof(ret)) _ret; \ - } while (0) - -#define opal_atomic_sc_32(addr, newval, ret) \ - do { \ - opal_atomic_int32_t *_addr = (addr); \ - int32_t _newval = (int32_t) newval; \ - int _ret; \ - \ - __asm__ __volatile__ ("stlxr %w0, %w2, [%1] \n" \ - : "=&r" (_ret) \ - : "r" (_addr), "r" (_newval) \ - : "cc", "memory"); \ - \ - ret = (_ret == 0); \ - } while (0) - static inline bool opal_atomic_compare_exchange_strong_64 (opal_atomic_int64_t *addr, int64_t *oldval, int64_t newval) { int64_t prev; @@ -272,32 +248,6 @@ static inline bool opal_atomic_compare_exchange_strong_rel_64 (opal_atomic_int64 return ret; } -#define opal_atomic_ll_64(addr, ret) \ - do { \ - opal_atomic_int64_t *_addr = (addr); \ - int64_t _ret; \ - \ - __asm__ __volatile__ ("ldaxr %0, [%1] \n" \ - : "=&r" (_ret) \ - : "r" (_addr)); \ - \ - ret = (typeof(ret)) _ret; \ - } while (0) - -#define opal_atomic_sc_64(addr, newval, ret) \ - do { \ - opal_atomic_int64_t *_addr = (addr); \ - int64_t _newval = (int64_t) newval; \ - int _ret; \ - \ - __asm__ __volatile__ ("stlxr %w0, %2, [%1] \n" \ - : "=&r" (_ret) \ - : "r" (_addr), "r" (_newval) \ - : "cc", "memory"); \ - \ - ret = (_ret == 0); \ - } while (0) - #define OPAL_ASM_MAKE_ATOMIC(type, bits, name, inst, reg) \ static inline type opal_atomic_fetch_ ## name ## _ ## bits (opal_atomic_ ## type *addr, type value) \ { \ diff --git a/opal/include/opal/sys/arm64/atomic_llsc.h b/opal/include/opal/sys/arm64/atomic_llsc.h new file mode 100644 index 00000000000..56dff4934c3 --- /dev/null +++ b/opal/include/opal/sys/arm64/atomic_llsc.h @@ -0,0 +1,92 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2010 IBM Corporation. All rights reserved. + * Copyright (c) 2010 ARM ltd. All rights reserved. + * Copyright (c) 2016-2018 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2021 Triad National Security, LLC. All rights reserved. + * Copyright (c) 2021 Google, LLC. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#if !defined(OPAL_SYS_ARCH_ATOMIC_LLSC_H) + +#define OPAL_SYS_ARCH_ATOMIC_LLSC_H + +#if OPAL_C_GCC_INLINE_ASSEMBLY + +#undef OPAL_HAVE_ATOMIC_LLSC_32 +#undef OPAL_HAVE_ATOMIC_LLSC_64 + +#define OPAL_HAVE_ATOMIC_LLSC_32 1 +#define OPAL_HAVE_ATOMIC_LLSC_64 1 + +#define opal_atomic_ll_32(addr, ret) \ + do { \ + opal_atomic_int32_t *_addr = (addr); \ + int32_t _ret; \ + \ + __asm__ __volatile__ ("ldaxr %w0, [%1] \n" \ + : "=&r" (_ret) \ + : "r" (_addr)); \ + \ + ret = (typeof(ret)) _ret; \ + } while (0) + +#define opal_atomic_sc_32(addr, newval, ret) \ + do { \ + opal_atomic_int32_t *_addr = (addr); \ + int32_t _newval = (int32_t) newval; \ + int _ret; \ + \ + __asm__ __volatile__ ("stlxr %w0, %w2, [%1] \n" \ + : "=&r" (_ret) \ + : "r" (_addr), "r" (_newval) \ + : "cc", "memory"); \ + \ + ret = (_ret == 0); \ + } while (0) + +#define opal_atomic_ll_64(addr, ret) \ + do { \ + opal_atomic_int64_t *_addr = (addr); \ + int64_t _ret; \ + \ + __asm__ __volatile__ ("ldaxr %0, [%1] \n" \ + : "=&r" (_ret) \ + : "r" (_addr)); \ + \ + ret = (typeof(ret)) _ret; \ + } while (0) + +#define opal_atomic_sc_64(addr, newval, ret) \ + do { \ + opal_atomic_int64_t *_addr = (addr); \ + int64_t _newval = (int64_t) newval; \ + int _ret; \ + \ + __asm__ __volatile__ ("stlxr %w0, %2, [%1] \n" \ + : "=&r" (_ret) \ + : "r" (_addr), "r" (_newval) \ + : "cc", "memory"); \ + \ + ret = (_ret == 0); \ + } while (0) + +#endif /* OPAL_GCC_INLINE_ASSEMBLY */ + +#endif /* ! OPAL_SYS_ARCH_ATOMIC_LLSC_H */ diff --git a/opal/include/opal/sys/atomic.h b/opal/include/opal/sys/atomic.h index 8e396384e6e..e17212e9fee 100644 --- a/opal/include/opal/sys/atomic.h +++ b/opal/include/opal/sys/atomic.h @@ -59,12 +59,6 @@ #include "opal/sys/architecture.h" #include "opal_stdatomic.h" -#if OPAL_ASSEMBLY_BUILTIN == OPAL_BUILTIN_C11 && !defined(__INTEL_COMPILER) - -#include "atomic_stdc.h" - -#else /* !OPAL_C_HAVE__ATOMIC */ - /* do some quick #define cleanup in cases where we are doing testing... */ #ifdef OPAL_DISABLE_INLINE_ASM @@ -72,6 +66,12 @@ #define OPAL_C_GCC_INLINE_ASSEMBLY 0 #endif +#if OPAL_ASSEMBLY_BUILTIN == OPAL_BUILTIN_C11 && !defined(__INTEL_COMPILER) + +#include "atomic_stdc.h" + +#else /* !OPAL_C_HAVE__ATOMIC */ + /* define OPAL_{GCC,DEC,XLC}_INLINE_ASSEMBLY based on the OPAL_C_{GCC,DEC,XLC}_INLINE_ASSEMBLY defines and whether we are in C or C++ */ @@ -642,6 +642,48 @@ static inline intptr_t opal_atomic_fetch_sub_ptr( opal_atomic_intptr_t* addr, vo #endif /* !OPAL_C_HAVE__ATOMIC */ +/****** load-linked, store-conditional atomic implementations ******/ + +/* C11 atomics do not expose the low-level load-linked, store-conditional + * instructions. Open MPI can use these instructions to implement a more + * efficient version of the lock-free lifo and fifo. On Apple Silicon the + * LL/SC fifo and lifo are ~ 2-20x faster than the CAS128 implementation. */ +#if OPAL_ASSEMBLY_ARCH == OPAL_ARM64 +#include "opal/sys/arm64/atomic_llsc.h" +#endif + +#if !defined(OPAL_HAVE_ATOMIC_LLSC_32) +#define OPAL_HAVE_ATOMIC_LLSC_32 0 +#endif + +#if !defined(OPAL_HAVE_ATOMIC_LLSC_64) +#define OPAL_HAVE_ATOMIC_LLSC_64 0 +#endif + +#if (OPAL_HAVE_ATOMIC_LLSC_32 || OPAL_HAVE_ATOMIC_LLSC_64) + +#if SIZEOF_VOID_P == 4 && OPAL_HAVE_ATOMIC_LLSC_32 + +#define opal_atomic_ll_ptr(addr, ret) opal_atomic_ll_32((opal_atomic_int32_t *) (addr), ret) +#define opal_atomic_sc_ptr(addr, value, ret) opal_atomic_sc_32((opal_atomic_int32_t *) (addr), (intptr_t) (value), ret) + +#define OPAL_HAVE_ATOMIC_LLSC_PTR 1 + +#elif SIZEOF_VOID_P == 8 && OPAL_HAVE_ATOMIC_LLSC_64 + +#define opal_atomic_ll_ptr(addr, ret) opal_atomic_ll_64((opal_atomic_int64_t *) (addr), ret) +#define opal_atomic_sc_ptr(addr, value, ret) opal_atomic_sc_64((opal_atomic_int64_t *) (addr), (intptr_t) (value), ret) + +#define OPAL_HAVE_ATOMIC_LLSC_PTR 1 + +#endif + +#else + +#define OPAL_HAVE_ATOMIC_LLSC_PTR 0 + +#endif /* (OPAL_HAVE_ATOMIC_LLSC_32 || OPAL_HAVE_ATOMIC_LLSC_64)*/ + END_C_DECLS #endif /* OPAL_SYS_ATOMIC_H */ diff --git a/opal/include/opal/sys/atomic_impl.h b/opal/include/opal/sys/atomic_impl.h index 4b1565cae83..e1ddcd64d3a 100644 --- a/opal/include/opal/sys/atomic_impl.h +++ b/opal/include/opal/sys/atomic_impl.h @@ -304,26 +304,6 @@ OPAL_ATOMIC_DEFINE_CMPXCG_PTR_XX(_rel_) #endif /* (OPAL_HAVE_ATOMIC_SWAP_32 || OPAL_HAVE_ATOMIC_SWAP_64) */ -#if (OPAL_HAVE_ATOMIC_LLSC_32 || OPAL_HAVE_ATOMIC_LLSC_64) - -#if SIZEOF_VOID_P == 4 && OPAL_HAVE_ATOMIC_LLSC_32 - -#define opal_atomic_ll_ptr(addr, ret) opal_atomic_ll_32((opal_atomic_int32_t *) (addr), ret) -#define opal_atomic_sc_ptr(addr, value, ret) opal_atomic_sc_32((opal_atomic_int32_t *) (addr), (intptr_t) (value), ret) - -#define OPAL_HAVE_ATOMIC_LLSC_PTR 1 - -#elif SIZEOF_VOID_P == 8 && OPAL_HAVE_ATOMIC_LLSC_64 - -#define opal_atomic_ll_ptr(addr, ret) opal_atomic_ll_64((opal_atomic_int64_t *) (addr), ret) -#define opal_atomic_sc_ptr(addr, value, ret) opal_atomic_sc_64((opal_atomic_int64_t *) (addr), (intptr_t) (value), ret) - -#define OPAL_HAVE_ATOMIC_LLSC_PTR 1 - -#endif - -#endif /* (OPAL_HAVE_ATOMIC_LLSC_32 || OPAL_HAVE_ATOMIC_LLSC_64)*/ - #if !defined(OPAL_HAVE_ATOMIC_LLSC_PTR) #define OPAL_HAVE_ATOMIC_LLSC_PTR 0 #endif diff --git a/opal/include/opal/sys/atomic_stdc.h b/opal/include/opal/sys/atomic_stdc.h index 9b98a131cd4..1c31df8b7b2 100644 --- a/opal/include/opal/sys/atomic_stdc.h +++ b/opal/include/opal/sys/atomic_stdc.h @@ -52,10 +52,6 @@ #define OPAL_HAVE_ATOMIC_XOR_64 1 #define OPAL_HAVE_ATOMIC_SUB_64 1 -#define OPAL_HAVE_ATOMIC_LLSC_32 0 -#define OPAL_HAVE_ATOMIC_LLSC_64 0 -#define OPAL_HAVE_ATOMIC_LLSC_PTR 0 - #define OPAL_HAVE_ATOMIC_MIN_32 1 #define OPAL_HAVE_ATOMIC_MAX_32 1 diff --git a/test/class/opal_fifo.c b/test/class/opal_fifo.c index 196c84a704d..9a2ea797866 100644 --- a/test/class/opal_fifo.c +++ b/test/class/opal_fifo.c @@ -107,10 +107,10 @@ static void *thread_test_exhaust (opal_object_t *arg) { static bool check_fifo_consistency (opal_fifo_t *fifo, int expected_count) { - volatile opal_list_item_t *volatile item; + opal_list_item_t * item; int count; - for (count = 0, item = fifo->opal_fifo_head.data.item ; item != &fifo->opal_fifo_ghost ; + for (count = 0, item = (opal_list_item_t *) fifo->opal_fifo_head.data.item ; item != &fifo->opal_fifo_ghost ; item = opal_list_get_next(item), count++); return count == expected_count; diff --git a/test/class/opal_lifo.c b/test/class/opal_lifo.c index 8e031b352cf..3f4d9b7d92d 100644 --- a/test/class/opal_lifo.c +++ b/test/class/opal_lifo.c @@ -70,7 +70,7 @@ static bool check_lifo_consistency (opal_lifo_t *lifo, int expected_count) opal_list_item_t *item; int count; - for (count = 0, item = lifo->opal_lifo_head.data.item ; item != &lifo->opal_lifo_ghost ; + for (count = 0, item = (opal_list_item_t *) lifo->opal_lifo_head.data.item ; item != &lifo->opal_lifo_ghost ; item = opal_list_get_next(item), count++); return count == expected_count;