]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
amdgcn, openmp: Fix concurrency in low-latency allocator
authorAndrew Stubbs <ams@codesourcery.com>
Wed, 19 Apr 2023 16:33:41 +0000 (17:33 +0100)
committerAndrew Stubbs <ams@codesourcery.com>
Thu, 20 Apr 2023 13:23:33 +0000 (14:23 +0100)
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.

libgomp/ChangeLog.omp
libgomp/basic-allocator.c

index 09cf9c6f3c14c8b2bc1ff0848cbc867c865e14b4..32bc3b0c82cea1c8c5e2c390993596b84bff2dac 100644 (file)
@@ -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)
index b4b9e4ba13a74be0b366c6669af5d02e186dce5f..a61828e48a0dbaf5f4490bba2d5362f2243e6593 100644 (file)
@@ -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);