From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1729) id D62843AA991A; Thu, 13 May 2021 16:19:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D62843AA991A Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Kwok Yeung To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/omp/gcc-11] nvptx: remove erroneous stack deletion X-Act-Checkin: gcc X-Git-Author: Andrew Stubbs X-Git-Refname: refs/heads/devel/omp/gcc-11 X-Git-Oldrev: 5c7c1a8ad52aa82ea5e18d4ba6fb03431e65edcf X-Git-Newrev: d71d7ccaa67fc0000ac5ff33ba48ddee9b48284b Message-Id: <20210513161941.D62843AA991A@sourceware.org> Date: Thu, 13 May 2021 16:19:41 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 May 2021 16:19:42 -0000 https://gcc.gnu.org/g:d71d7ccaa67fc0000ac5ff33ba48ddee9b48284b commit d71d7ccaa67fc0000ac5ff33ba48ddee9b48284b Author: Andrew Stubbs 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/plugin/plugin-nvptx.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c index 23573416a12..96f2c13a191 100644 --- a/libgomp/plugin/plugin-nvptx.c +++ b/libgomp/plugin/plugin-nvptx.c @@ -1412,8 +1412,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;