From 86a04ff9b51ccf512ccb7578497100888f5f9925 Mon Sep 17 00:00:00 2001 From: Andrew Stubbs Date: Tue, 23 Feb 2021 21:35:08 +0000 Subject: [PATCH] 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. --- 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 e5a076be5576..4bf75fd6861a 100644 --- a/libgomp/ChangeLog.omp +++ b/libgomp/ChangeLog.omp @@ -1,3 +1,8 @@ +2021-02-23 Andrew Stubbs + + * plugin/plugin-nvptx.c (GOMP_OFFLOAD_alloc): Remove early call to + nvptx_stacks_free. + 2021-02-02 Chung-Lin Tang * libgomp-plugin.h (GOMP_OFFLOAD_supported_features): New declaration. diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c index 9c6b5d395a29..eeadc906d03a 100644 --- a/libgomp/plugin/plugin-nvptx.c +++ b/libgomp/plugin/plugin-nvptx.c @@ -1428,8 +1428,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; -- 2.47.2