aboutsummaryrefslogtreecommitdiffstats
path: root/src/mutex.c
diff options
context:
space:
mode:
authorDavid Goldblatt <davidgoldblatt@fb.com>2017-10-03 18:03:02 -0700
committerDavid Goldblatt <davidtgoldblatt@gmail.com>2017-10-04 18:37:23 -0700
commit1245faae9052350a96dbcb22de7979bca566dbec (patch)
tree19043580b26ec4953bab4435e44206d71e7db697 /src/mutex.c
parent7c6c99b8295829580c506067495a23c07436e266 (diff)
downloadplatform_external_jemalloc_new-1245faae9052350a96dbcb22de7979bca566dbec.tar.gz
platform_external_jemalloc_new-1245faae9052350a96dbcb22de7979bca566dbec.tar.bz2
platform_external_jemalloc_new-1245faae9052350a96dbcb22de7979bca566dbec.zip
Power: disable the CPU_SPINWAIT macro.
Quoting from https://github.com/jemalloc/jemalloc/issues/761 : [...] reading the Power ISA documentation[1], the assembly in [the CPU_SPINWAIT macro] isn't correct anyway (as @marxin points out): the setting of the program-priority register is "sticky", and we never undo the lowering. We could do something similar, but given that we don't have testing here in the first place, I'm inclined to simply not try. I'll put something up reverting the problematic commit tomorrow. [1] Book II, chapter 3 of the 2.07B or 3.0B ISA documents.
Diffstat (limited to 'src/mutex.c')
-rw-r--r--src/mutex.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mutex.c b/src/mutex.c
index a528ef0c..3de7f44a 100644
--- a/src/mutex.c
+++ b/src/mutex.c
@@ -4,6 +4,7 @@
#include "jemalloc/internal/assert.h"
#include "jemalloc/internal/malloc_io.h"
+#include "jemalloc/internal/spin.h"
#ifndef _CRT_SPINCOUNT
#define _CRT_SPINCOUNT 4000
@@ -53,7 +54,7 @@ malloc_mutex_lock_slow(malloc_mutex_t *mutex) {
int cnt = 0, max_cnt = MALLOC_MUTEX_MAX_SPIN;
do {
- CPU_SPINWAIT;
+ spin_cpu_spinwait();
if (!malloc_mutex_trylock_final(mutex)) {
data->n_spin_acquired++;
return;