Skip to content

Commit 7cb153b

Browse files
author
Ole John Aske
committed
Bug#34594825 NdbSpin_Init calculates wrong number of loops in NdbSpin
Clean up the cpu_pause definitions in the HW abstraction layer mt-asm.h: Fixes two related cpu_pause issues: 1) Empty (and unused) definitions for cpu_pause() where provided for platforms which didn't #define NDB_HAVE_CPU_PAUSE - GNUC compiling code for __sparc - SUN STUDIO compiling code for __sparc 2) For ARM architecture '__aarch64__' (Apple M1/M2) an implementation of cpu_pause() was provided. As it didn't also #define NDB_HAVE_CPU_PAUSE the 'pause' was unused. Thus, usage of spin was effectively disabled on that platform. Change-Id: I9e1bd11f26ea861240be4753cadbb58e72f29fd9
1 parent 450b0c6 commit 7cb153b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

storage/ndb/include/portlib/mt-asm.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,8 @@ xcng(volatile unsigned * addr, int val)
107107
asm volatile("membar #StoreLoad | #StoreStore");
108108
return ret;
109109
}
110-
#define cpu_pause()
111110
#define NDB_HAVE_XCNG
112111
#else
113-
#define cpu_pause()
114112
/* link error if used incorrectly (i.e wo/ having NDB_HAVE_XCNG) */
115113
extern int xcng(volatile unsigned * addr, int val);
116114
#endif
@@ -150,6 +148,7 @@ xcng(volatile unsigned * addr, int val)
150148
#define NDB_HAVE_RMB
151149
#define NDB_HAVE_WMB
152150
//#define NDB_HAVE_XCNG
151+
#define NDB_HAVE_CPU_PAUSE
153152

154153
#define mb() std::atomic_thread_fence(std::memory_order_seq_cst)
155154
#define rmb() std::atomic_thread_fence(std::memory_order_seq_cst)

0 commit comments

Comments
 (0)