https://gcc.gnu.org/g:9923231220713968375f689a9c81f77b93296c98

commit 9923231220713968375f689a9c81f77b93296c98
Author: Andrew Stubbs <a...@codesourcery.com>
Date:   Tue Feb 23 21:35:08 2021 +0000

    nvptx: remove erroneous stack deletion
    
    The stacks are not supposed to be deleted every time memory is allocated, 
only
    when there is insufficient memory.  The unconditional call here seems to be 
in
    error, and is causing a costly reallocation of the stacks before every 
launch.
    
    libgomp/
    
            * plugin/plugin-nvptx.c (GOMP_OFFLOAD_alloc): Remove early call to
            nvptx_stacks_free.

Diff:
---
 libgomp/ChangeLog.omp         | 5 +++++
 libgomp/plugin/plugin-nvptx.c | 2 --
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp
index c6c0a47e580..2ca82622336 100644
--- a/libgomp/ChangeLog.omp
+++ b/libgomp/ChangeLog.omp
@@ -1,3 +1,8 @@
+2021-02-23  Andrew Stubbs  <a...@codesourcery.com>
+
+       * plugin/plugin-nvptx.c (GOMP_OFFLOAD_alloc): Remove early call to
+       nvptx_stacks_free.
+
 2021-01-13  Julian Brown  <jul...@codesourcery.com>
 
        * testsuite/libgomp.oacc-c-c++-common/loop-gwv-1.c: Adjust for loop
diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c
index 5aad3448a8d..36527bcbed9 100644
--- a/libgomp/plugin/plugin-nvptx.c
+++ b/libgomp/plugin/plugin-nvptx.c
@@ -1581,8 +1581,6 @@ GOMP_OFFLOAD_alloc (int ord, size_t size)
   ptx_dev->free_blocks = NULL;
   pthread_mutex_unlock (&ptx_dev->free_blocks_lock);
 
-  nvptx_stacks_free (ptx_dev, false);
-
   while (blocks)
     {
       tmp = blocks->next;

Reply via email to