From patchwork Tue Sep 10 13:55:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Stubbs X-Patchwork-Id: 1160373 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508765-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="CXLfqiIV"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46SRQ96YSfz9s00 for ; Tue, 10 Sep 2019 23:55:59 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=ECJ9fosIh3uKbg9TJUKI5OR4kXLw8Ngu9iIO1T1XJT/qvB+yim r/S9GVDX/jiPwj0aqV0niZNiywTKxoLcftfmOO1uqXcy7enQfvo4W6fnGngbZ9mj SB6cN4tS3i+99ZbW6y/PYA5OFKplKdgKMx6ypDisg+S7/GiGMi+BIv+7I= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=B7c9fqprLwbMKs3vKkF/2aCxXkI=; b=CXLfqiIVTqNKu+WLKBKq +SiQqtnLNPgUA5hDrNy0DxzvnJ9iMlAOKyAUTq4+sIOM8z/JuBHVLTSY35ocFrNs G6a5t7hG0p0oFMLMCWbbcQEj8XYnAIet2Z24E7xKcDFvfLOVYnudnKy5+SX+wD0y zLF5Oy4FQwqi/rEOIrV2+tc= Received: (qmail 22666 invoked by alias); 10 Sep 2019 13:55:52 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 22401 invoked by uid 89); 10 Sep 2019 13:55:52 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=(unknown), teams X-HELO: esa3.mentor.iphmx.com Received: from esa3.mentor.iphmx.com (HELO esa3.mentor.iphmx.com) (68.232.137.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Sep 2019 13:55:51 +0000 IronPort-SDR: O8dTb1YN8oAH0wy8qxTZDnp94U/uLHFeSZaHv1MUwd+FKZ9g0VBxjJ+kXIXK7Ckq4/skQLo6gn kYwcybREncg5CM1mMk3vA2i/6tBM1yXUKlbin6jyok5nUDnwxIR3huYPZzu03Oozy9jiRvcIRy HBKZ0Gpy3Xz5n8FuZZEiNm/6zT0V/pF6aPe6iFveMD35wqf/uNW8jAPjxgkL7s5y/D+KNvXtse 5Hdc95jfJGvHsYzkU+tE637yeLLLZLJ7nbABwVAPJVo3FVQU/Wjdqgx2F6IndsWhwHpjQKmy0v +0I= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 10 Sep 2019 05:55:35 -0800 IronPort-SDR: 67RuZ/VzSwP3htiPVjDLI/J7WKnfPhAPLe0ZX0Jbat18c2VNZqUIfIGdpg1mNgjmQ5m41hVOY6 2OGPN1l9DZwq5SnaEIbVyDJ2+81bU5crNc+al/I33dtUAwHexaCj2byUI/y7wjpGxN940nBwez J4TXRkobXU/hvKD3vVedcEf9et5A+if3hlnqOcdNqtp70J5RPShaKfgmZnaSsFctUieFySFEdK ult4iwIixYh9BJ0MBY1NponQW9pelQJ/Yqj/lVBC68HTmHL4RWd5D7yqwiZoMWVqo++6+abbbF jCY= To: "gcc-patches@gcc.gnu.org" CC: Kwok Cheung Yeung From: Andrew Stubbs Subject: [OG9, amdgcn, committed] Fix memory leak in libgomp Message-ID: <7e8ff8ab-6918-ae65-c59f-b30103506185@codesourcery.com> Date: Tue, 10 Sep 2019 14:55:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 Committed to OG9 on behalf of Kwok ... The list of struct gomp_threads allocated in gomp_gcn_enter_kernel was not being freed in gomp_gcn_exit_kernel, leading to a small memory leak every time a kernel is run. Runs with a lot of teams or many kernels were running out of heap space. Andrew Fix memory leak in libgomp when using OpenMP 2019-09-10 Kwok Cheung Yeung libgomp/ * config/gcn/team.c (gomp_gcn_exit_kernel): Free GCN thread list. diff --git a/libgomp/config/gcn/team.c b/libgomp/config/gcn/team.c index 79aec65a24e..534cf595c98 100644 --- a/libgomp/config/gcn/team.c +++ b/libgomp/config/gcn/team.c @@ -93,6 +93,7 @@ void gomp_gcn_exit_kernel (void) { gomp_free_thread (gcn_thrs ()); + free (gcn_thrs ()); } /* This function contains the idle loop in which a thread waits