From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1461) id 177553858D3C; Tue, 12 Sep 2023 16:12:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 177553858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694535150; bh=uQFWAwBsPqcPznRqfR2Tw0UnSxrNtD1axUcpv0bjhI0=; h=From:To:Subject:Date:From; b=fzxj1zV/JNheL2nC8232ViYVcb8jTEQeUb4P0iso50J6iK4pbzGCW8v2zQdjAJmJI zN9yXDnpP392hK4NopbLhtJsoWDgM0NzhiVbKMWh4PqZfxYPUZEMAZB6PDaW1IE200 R2YU5wy5n0mFW/zxy7HHGHmlAXEKOAohvH729F04= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Andrew Stubbs To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/omp/gcc-13] nvptx: update comment re delayed free X-Act-Checkin: gcc X-Git-Author: Andrew Stubbs X-Git-Refname: refs/heads/devel/omp/gcc-13 X-Git-Oldrev: 0cf5ac34de14ec4a8d35bad9bbd754e02e77b398 X-Git-Newrev: ea922f2d6e0c8e454bc503eaf321e534702d7ece Message-Id: <20230912161230.177553858D3C@sourceware.org> Date: Tue, 12 Sep 2023 16:12:30 +0000 (GMT) List-Id: https://gcc.gnu.org/g:ea922f2d6e0c8e454bc503eaf321e534702d7ece commit ea922f2d6e0c8e454bc503eaf321e534702d7ece Author: Andrew Stubbs Date: Mon Sep 11 17:58:40 2023 +0100 nvptx: update comment re delayed free Polling the delayed free is roughly the same as freeing them between reverse offload kernels. libgomp/ChangeLog: * plugin/plugin-nvptx.c (GOMP_OFFLOAD_run): Update comment. Diff: --- libgomp/plugin/plugin-nvptx.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c index 176bb983bdc1..0cf497195151 100644 --- a/libgomp/plugin/plugin-nvptx.c +++ b/libgomp/plugin/plugin-nvptx.c @@ -2703,12 +2703,10 @@ GOMP_OFFLOAD_run (int ord, void *tgt_fn, void *tgt_vars, void **args) a following reverse offload does 'GOMP_OFFLOAD_page_locked_host_alloc', and that then runs the deferred 'cuMemFreeHost's -- which may dead-lock?! - TODO: This may need more considerations for the case that - different host threads do reverse offload? We could move - 'free_host_blocks' into 'aq' (which is separate per reverse - offload) instead of global, like - 'page_locked_host_unregister_blocks', but that doesn't seem the - right thing for OpenACC 'async' generally? */ + Note: even though the reverse offload kernels are now run in + multiple backgroud threads, *this* thread (or one of these + threads, anyway) will live the whole time, so polling + free_host_blocks should be effective. */ if (!nvptx_run_deferred_page_locked_host_free ()) exit (EXIT_FAILURE); }