public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/omp/gcc-13] amdgcn, openmp: Fix concurrency in low-latency allocator
@ 2023-05-19 16:55 Kwok Yeung
0 siblings, 0 replies; only message in thread
From: Kwok Yeung @ 2023-05-19 16:55 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:5410e14552bcf400633556b563a90f6f2e00727e
commit 5410e14552bcf400633556b563a90f6f2e00727e
Author: Andrew Stubbs <ams@codesourcery.com>
Date: Wed Apr 19 17:33:41 2023 +0100
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.
Diff:
---
libgomp/ChangeLog.omp | 5 +++++
libgomp/basic-allocator.c | 2 ++
2 files changed, 7 insertions(+)
diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp
index d98ca622634..65a5d97e522 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 afddc79cf75..167acee94fb 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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-05-19 16:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-19 16:55 [gcc/devel/omp/gcc-13] amdgcn, openmp: Fix concurrency in low-latency allocator Kwok Yeung
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).