aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Stubbs <ams@codesourcery.com>2023-04-19 17:33:41 +0100
committerAndrew Stubbs <ams@codesourcery.com>2023-04-20 14:23:33 +0100
commitc4116975a5d396f3503b86c0c8cbfe6fffcb146b (patch)
tree9a7ba4075731dc1c091c4acedd0ef0e789c3df3a
parente7f0cec3b8e43e287ecde4183b40d786f0acc917 (diff)
downloadgcc-c4116975a5d396f3503b86c0c8cbfe6fffcb146b.zip
gcc-c4116975a5d396f3503b86c0c8cbfe6fffcb146b.tar.gz
gcc-c4116975a5d396f3503b86c0c8cbfe6fffcb146b.tar.bz2
amdgcn, openmp: Fix concurrency in low-latency allocator
The previous code works fine on Fiji and Vega 10 devices, but bogs down in The spin locks on Vega 20 or newer. Adding the sleep instructions fixes the problem. libgomp/ChangeLog: * basic-allocator.c (basic_alloc_free): Use BASIC_ALLOC_YIELD. (basic_alloc_realloc): Use BASIC_ALLOC_YIELD.
-rw-r--r--libgomp/ChangeLog.omp5
-rw-r--r--libgomp/basic-allocator.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp
index 09cf9c6..32bc3b0 100644
--- a/libgomp/ChangeLog.omp
+++ b/libgomp/ChangeLog.omp
@@ -1,3 +1,8 @@
+2023-04-20 Andrew Stubbs <ams@codesourcery.com>
+
+ * basic-allocator.c (basic_alloc_free): Use BASIC_ALLOC_YIELD.
+ (basic_alloc_realloc): Use BASIC_ALLOC_YIELD.
+
2023-04-03 Thomas Schwinge <thomas@codesourcery.com>
* target.c (gomp_map_vars_internal)
diff --git a/libgomp/basic-allocator.c b/libgomp/basic-allocator.c
index b4b9e4b..a61828e 100644
--- a/libgomp/basic-allocator.c
+++ b/libgomp/basic-allocator.c
@@ -188,6 +188,7 @@ basic_alloc_free (char *heap, void *addr, size_t size)
break;
}
/* Spin. */
+ BASIC_ALLOC_YIELD;
}
while (1);
@@ -267,6 +268,7 @@ basic_alloc_realloc (char *heap, void *addr, size_t oldsize,
break;
}
/* Spin. */
+ BASIC_ALLOC_YIELD;
}
while (1);