From nobody Sun May 12 18:09:10 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcrGt3jHmz5KRyh; Sun, 12 May 2024 18:09:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VcrGt2HJ8z4d7y; Sun, 12 May 2024 18:09:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715537350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oALKsNVjYqrJPSNpGDq+WCjLD9+vkIf0FUsBPohWQ9s=; b=gzBGrWZcgjI+iF0oDVGlttlruqlxtrOTQw4lHMJGx9dKmCSlJWO+MFiqonFm3P0fxcAODt jV244Qw9mlXUEgfNfI89KY1l6aqB5O3OHK/IUUQFUAuL2zmFrrPORFCHFO9zZ3nYyRH2QJ 10SlTsuflCRS+UosT8FTgUg9wXFOnNTCJTl45siH0jJeHvZ03X5ygNZPlPIf5cScxEgfXC DmH8/Dd/TgbUEjjPFYUR5FVVAZg9pSKjCVW1N2iHWjG7WPIQFxwu2CemCJu+NUJQ4i3FB+ y3axJv711de/zoi9SybY3keWpOe0x/1AoLFinHWZ+Ht82/Qi55c1w88TNYVgtQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715537350; a=rsa-sha256; cv=none; b=nH7BVqoOshxEatH0nCCJsJKBR0Lzwaz7lzOORxx6oUGe+k7ffGxoAB9uf2r2Q63yY076m7 kN0YfQY2lVphLDtxWzisnGL4Fv0x3GIQeMFvs2avlX5Yep2NLKOW4cqvcFZF81MFZEbZaW qCnW+RchLiAKZ1DaBUvyfaY2JGiLBoTq9GesriKBOvUNDOmM85KhnYqnbiRd6l76r1lWWm LO30z8kW0tae6soiE87jd3Z4BvRoHpYISZq0W9JOM4hH1y8lto2oArCCPc9xeKLC3oCJUE 6XfR6hE5wFq0B7snR0CnCCOUBorKRcu8PXE13FYrO6o1hF7rq4VpP8HzymcIfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715537350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oALKsNVjYqrJPSNpGDq+WCjLD9+vkIf0FUsBPohWQ9s=; b=Uuv56jNOriGaTweKJGhtnXksAa0ZNNIeckN3n/cFvHFbYzsIVoH3rq2JQmqaoA2FAIUxKh uaw63Z9bNyWm7UzGsQ/qUi7snYMxB2FWdOEXOiJtCMvkhpGq8IZLaa0NFyKFVNiA/dc/OW xJz0N4EWapd75tr0m8eEZ4Nw4TAmF0XssGhOkP192dJA9UzfmcKTe1Hfk41WWbZWcu7LzQ b4nxfvXF1dBfpehBeU4mWE3iOvqsDEn44zkDNQbchj6RafzhFfJEWUjHeVq13urPfQ96Rr gMWnGI9ZXa8RnreHQbK4BebPyzFynlfevGmyJYYrkE9iGh4rJQ5qSNHJSoyDnQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VcrGt1txqz1Crb; Sun, 12 May 2024 18:09:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44CI9Aht028722; Sun, 12 May 2024 18:09:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44CI9A8m028719; Sun, 12 May 2024 18:09:10 GMT (envelope-from git) Date: Sun, 12 May 2024 18:09:10 GMT Message-Id: <202405121809.44CI9A8m028719@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: aec52a27f987 - releng/14.1 - Merge commit 5300a6731e98 from llvm-project (by Jonathan Peyton): List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: aec52a27f987eef4f21c07f83cdc783fbdede2db Auto-Submitted: auto-generated The branch releng/14.1 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=aec52a27f987eef4f21c07f83cdc783fbdede2db commit aec52a27f987eef4f21c07f83cdc783fbdede2db Author: Dimitry Andric AuthorDate: 2024-05-08 16:55:08 +0000 Commit: Dimitry Andric CommitDate: 2024-05-12 18:08:18 +0000 Merge commit 5300a6731e98 from llvm-project (by Jonathan Peyton): [OpenMP] Fix re-locking hang found in issue 86684 (#88539) This was initially reported here (including stacktraces): https://stackoverflow.com/questions/78183545/does-compiling-imagick-with-openmp-enabled-in-freebsd-13-2-cause-sched-yield If `__kmp_register_library_startup()` detects that another instance of the library is present, `__kmp_is_address_mapped()` is eventually called. which uses `kmpc_alloc()` to allocate memory. This function calls `__kmp_entry_thread()` to access the thread-local memory pool, which is a bad idea during initialization. This macro internally calls `__kmp_get_global_thread_id_reg()` which sets the bootstrap lock at the beginning (before calling `__kmp_register_library_startup()`). The fix is to use `KMP_INTERNAL_MALLOC()`/`KMP_INTERNAL_FREE()` instead of `kmpc_malloc()`/`kmpc_free()`. `KMP_INTERNAL_MALLOC` and `KMP_INTERNAL_FREE` do not use any bootstrap locks. They just translate to `malloc()`/`free()` and are meant to be used during library initialization before other library-specific allocators have been initialized. Fixes: #86684 This should fix OpenMP processes sometimes getting locked with 100% CPU usage, endlessly calling sched_yield(2). PR: 278845 Reported by: Cassidy B. Larson Approved by: re (cperciva) MFC after: 3 days (cherry picked from commit da15ed2e982180198f77a0fa26628e6d414cb10e) (cherry picked from commit 426e07d791641e80e90af89d52008635a35e4794) --- contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp b/contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp index b9ff96873702..97ddb8a608b7 100644 --- a/contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp +++ b/contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp @@ -2129,10 +2129,10 @@ int __kmp_is_address_mapped(void *addr) { // We pass from number of vm entry's semantic // to size of whole entry map list. lstsz = lstsz * 4 / 3; - buf = reinterpret_cast(kmpc_malloc(lstsz)); + buf = reinterpret_cast(KMP_INTERNAL_MALLOC(lstsz)); rc = sysctl(mib, 4, buf, &lstsz, NULL, 0); if (rc < 0) { - kmpc_free(buf); + KMP_INTERNAL_FREE(buf); return 0; } @@ -2156,7 +2156,7 @@ int __kmp_is_address_mapped(void *addr) { } lw += cursz; } - kmpc_free(buf); + KMP_INTERNAL_FREE(buf); #elif KMP_OS_DARWIN