From patchwork Tue Oct 14 14:43:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kumar Dora X-Patchwork-Id: 72257 X-Patchwork-Delegate: steve@sakoman.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3D91CCD184 for ; Tue, 14 Oct 2025 14:44:30 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.web10.18452.1760453065065813835 for ; Tue, 14 Oct 2025 07:44:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=K/typhVS; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=2382047737=sunilkumar.dora@windriver.com) Received: from pps.filterd (m0250809.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 59E6ipvB2161760 for ; Tue, 14 Oct 2025 07:44:24 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=oq6EBanvw/3heNB7k09hxftpg21/XfjaRwym+Io6I3k=; b= K/typhVSPide4/UumGe7HL/sHYu1zroR9SpVdjfe4qIL9WKX9mOBcihxPE0Oe1Yq ZaOkFyGQz+vgVmr2fTU/og15UZIbdLZWo11MeNt7CIXJ2qXI2PM+MTTbHjw8NfmF WPiZ/tcsS28RWrEfPeYi1AVV9CEeTaKvgsN7Oo6SJRoF4wzRzBAGvFH26IL9q6nq v3pykqDnN72Auy0AQPG/Bsj1kZwO5SBZOQj0Z3+MdOTIA67LI8IUy8yYfSd+C0Js 4TP3KAyEpPs9EoyFP+pZfKIRukU3vVtGNVk+ANq6rM6Y1w+OKLsRFdZiPOmvPIXh GKs2q8MGrTquD1ibwzFCwA== Received: from ph0pr06cu001.outbound.protection.outlook.com (mail-westus3azon11011048.outbound.protection.outlook.com [40.107.208.48]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 49qprdtxyw-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Tue, 14 Oct 2025 07:44:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CGtledjzSdV0x2tYfIFqZaiVcXQ/A1XMoBZo5HfRPSvwN2pMxo9xkQ6zPF+j5w1XyK9uedjhUC9vaXToEfF38lwAcCWQ1/vW+v4NLUjuoDVUgX2VSpqC/OMKuwqlL2oKw18PAbU5+emMpuuSycniYtblrHOpxvxHRVTxl6kXChc0Qboj0L1S8TSyMfkF6OPrS99D7+NKKNjRqKNkkpbX3sYgizdopWct4p3g8pKA673aaQLVI3waAIUu1PdFRXnBPK3TmLbkAVwmwdlz7lnWfro5VLo5iuU7aDJ7PLXbvQzYKl5Nx6zqc3v9iS4pVBfRQh7WhoV1FfCR8iS+vDlHkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oq6EBanvw/3heNB7k09hxftpg21/XfjaRwym+Io6I3k=; b=OXhq9jwEkw+LpKvTW2V0fvfgwiZR1IjP6qsbaayaBp8QGn5dBCjrWynECzAloVaxaopt4lBY6SSCbXSH3IM3c2SYMpmLns1RA+Y4jqZb/YiNCp81KhmGAjVsvrUc8pDgl+ow2WlBkAqEYfWP2a3RcMug5hbLBtykg2rMMOkGeFQ2wQADnBCDPCazud1nQLwLXAg9CpPZuaYFNRrT2/J8qr0AovA3PBZLOz+KRliYqywrunhu/RxyqmtY0NkF9PH/rNsd24QgXV90Sxyomv89vpjhLYQ8h639jN2wbBvtHJsk/IytbGxsYWBeLe39/jLKcPHY6DgDntf6zlIlr3BHRA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from DS0PR11MB7901.namprd11.prod.outlook.com (2603:10b6:8:f4::20) by DM4PR11MB6381.namprd11.prod.outlook.com (2603:10b6:8:bd::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9228.10; Tue, 14 Oct 2025 14:44:22 +0000 Received: from DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::9fa:eb3f:cf26:264d]) by DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::9fa:eb3f:cf26:264d%3]) with mapi id 15.20.9203.009; Tue, 14 Oct 2025 14:44:22 +0000 From: sunilkumar.dora@windriver.com To: openembedded-core@lists.openembedded.org Cc: Sundeep.Kokkonda@windriver.com, sunilkumar.dora@windriver.com Subject: [kirkstone][PATCH 01/11] glibc: Remove partial BZ#25847 backport patches Date: Tue, 14 Oct 2025 07:43:37 -0700 Message-ID: <20251014144347.536537-2-sunilkumar.dora@windriver.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251014144347.536537-1-sunilkumar.dora@windriver.com> References: <20251014144347.536537-1-sunilkumar.dora@windriver.com> X-ClientProxiedBy: SJ0PR03CA0279.namprd03.prod.outlook.com (2603:10b6:a03:39e::14) To CH3PR11MB7896.namprd11.prod.outlook.com (2603:10b6:610:131::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7901:EE_|DM4PR11MB6381:EE_ X-MS-Office365-Filtering-Correlation-Id: 0101e778-3b11-4826-195e-08de0b3029da X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|52116014|38350700014|13003099007; X-Microsoft-Antispam-Message-Info: TqdoHtddMwhMo/UbsvKu09tuCYa34es2paaKJK5Ws6efDrw0/CpO0pPTEI1f3qdH9x0NLedv+zOt+pTqPnupcp/u+8whieLlOB7X3ZlEazxEkzjWjNGGVoZyfgP8igQM8sJyyqtTmox+D/k6M1d8GbCxLJaA8MFcFr1XZ88gdKkSysi9eVNtUyb1FzS7ch0FBvfKc5twAw5Ax1tI/PDZqjaCPK1NkcF+NgGluUjqz4mMVqiVffe6dAUwqp9wRBTEnxIOyWzYyltrKnJtwve6zY4NeWm/otOa2acRtSH6FrRjRTsjLelbvtKoqNd5d3IqMeKmiswVlMRl+8bi8VZoNCHRL7RG/Y5nYI8JeW0XSa7ZD9+mVONjOkmysMHsQ47W4AXFm185zl5QWySFPiinTXsxXMhgCoRkXuoLbZulAc8XApu2WAsCJirDBcULmRBaP4lkrVrRg4X57SLaVpicSRXPCZazLg4f7+FWA5Cgao0zI5WGFp8emiH9QTzkObHQpdL6X5JQVVGNU+En1dAPuvsmtZWdexFZ8v1r/07oAXZA7PX+hAxuTgj5HLjy2oTZrtRJsDR0smNXfixWteP3d64TyYdvdh3r5/NoUgEt/XJbJDP8YT/bJC7RsI7PAU9nLF5RcR0wBqeWYiXmN0JTS0Zwt4CZVlG+ZGJTlisrmlLyqy41HzNVsyUVxaE4SGReKPnOWksvFAlbfW9pWt5s51Xwn5ETYmdVwiiQYJ22wgC0OsNcOVEYh72JCjGJukklldPF3r0loqvtZyBoe/KvEfjLFVJJxysvvuxYIkZqCPGLXew0g85bin68RT9K8ou7LtSKV2KxD5yf5l30nyC2bh3iGrK5VMq3NJZM0aYTleNHhPfHTiP16NnJpGJk7b5yl+eYW6RQQedVpf+Wh2uflCJPzXuFApoyXCKg5xtzbF364/4q3qfUx6ZZWGBRJeXh5QH7gpDMpVfq3X/p4F9X0KxHLeRs6O5P3gqZQmkP3I8RS11IOX74GGMwoshe/ywqgBTSg/Pk2O5rRtsiqyoqp2K0+ZyNBOD4jQluak4tl/okvldUlVEsQ+UGUNBvNZslpTZK9yXjguHKeo8MfozSAd6u14HWDtJAz2Il/mfLfJxWQZAi95Qs0mx7WRm89qYWCAX1aLNHzRmYaq5bCAXipiPb9KRtp8jFsUwyS8BQIbPgyPmQhHYa6/x4Xv/ngOtSt4R+1B4ITKURwKZEWHDMSYsPtYLZ1HGi9iUmc3Eo6903HJaw+0rQ9z6jxMhhPl+iFuQ1Jd1Oy6ZpMKQJ92yfbSFVadwQno4cX2G9YdHc9kSZb26DYcLQ3EkqyWwBi6ZsNyY05iyV92mSHH9h0UK71jvMrymBjBo1c+WfOtA5IeVh4/0R/L3QHd/opBUxZNAFdWKBr73MaOvn/RZHVGABBSTvGLWsXkuGz/SmMcAX0hLQRB8PSE6vhnpAdtY++ptIPKX6VSKHV8dD/7xNBm8Duw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB7901.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016)(52116014)(38350700014)(13003099007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AZxk/bNl0BU1I5fnj35Mc9K+yvcqp7aK7msbR3VHhPhuTOm3lp9ol5kPrsGM6iiYgnYhNu1k31pmxzDDb6/oMFcIZ8ZJ0MVb+wSc+P85FlpoV+5K0QxiOUunRFMk9FAqT73BcUCDl8+RLexj3aDTJU6c5mfS+un9Dklx5tNQZOf1L9Mfz9AE/yjL0TuqqLCOgUCUa+kx7c+SunHG0/HayLuef0naF8cJYB8/iKZhpNPUS3BttEqQt6/REoyVqXQEth5wrKRVpVxrIyp4ArcsbVl5lCpmeR5l4Zbzy94ZrJ9O395eLupIm7NQk/dtK+gCgG8ijzoTNdV0aNncN7pM0SUEv3EqIPz+1Sgak9cARQMfT+XJYSPpliBzZJvrexekh8nGRoj7AtAbRs4CMAuJiJILjjwUaFKkGPSQ3k7RVXjyl8hxIIaB6CJVxOmIsXDr2ojcmjgFJClobAc/tjGCq7/2e9hz29UNrUpQjs1uvrqyhJVPr+IDSWK2I33M4rVEkSU2QX8ShunWF9Px9NQ39q6hugR3T7dKNJZaCoW+ftDNVESo9D+EnUlV+kZRWHAxjZwyvvpyvzCAUTG3CJ+VM5hPPhCJGgV777N87NNFOoL3jUpbHpJFpsUGYZBJ6cpzn0JrEIHoKYR8a2Rhc1e0wL5LrwWngmwBwORfdIQADvTEZiXyQjN+DCrVF/FfTnOfauzlcWA8gAxGDp5MU6Rvbn8ZxmLJ6t3xl62ZjpHrfuRuoNZ/8bKe3AMXfTPR8Q1p7GvkisfttDcE4+w0+ueGr906vUcrgNou80ZPu0hF7qLPkAFTGqEo8KqlZ9efUm7g7HIToODLR+7hCXTjdV2D5mMu8TN4qqLwyW8bBuYXyoapt/5XAYT9hmQimmHM4os84UUMzWI6Zdk1x7uQG8XO98xIlWbwsC2/LLmuHp5h3HrdQJPepD3bCFaZHVGC/lvdCexirLM+phbjsZXt8Ztm7fRHUzq27glLDogZnXYjryndntVKyRrozTdrcF1DiwWVOwbZT2RpT3ZIcGN4NS0gS1A9byPmvRZfcOwgimWG6I/VFi4SNA/YZdOf1x3l2Y3wCwU7zhmLimrPn4kAUmC43ohFuL/SvVWztAx3Nqj8s4ssps8pRFeKR442Sow5Rf4oJ7cm6gNpoeX6jf1znauMVw0pIlFFO75g/JYFvXHIUb2Z5KbxAn5l3LYqeDAeOM5SBag7qMG7/335YuGMkrphDVjOwt88NAlYGjVlZHO8imZE37z8uKJRmgDqAHlI85T5nvaFbR2xWAoaewNAbqnOU/yatuMFSpV5X5vIDYv2uL07kc38wjlp4Q0P0QAfMey0fc+I6ByQ7W8VBZVJh4kIBXw866PTyXn5vW51HC+s/1EgjFNOg/ra+s3iKCH85hxqW0y1AErP3jvox9vMManuNWSClIODwZwPJFvMcYc3WuD7lon9+GBfrpVOVM7tDlS3xgcFczNwsh2yOVnuXCBbbAXsUyHIiBjlGT8vmJC0RTwV8KHnq5ulEMtUIKPWeduJ6A4uDnmzl3822Lwg3S9PrfPnmySwHnJngl+CQxa4i/5s0waiosrWFu3sLbFBrgDBSXGYHTVjob6OyaFsZYQY1w== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0101e778-3b11-4826-195e-08de0b3029da X-MS-Exchange-CrossTenant-AuthSource: CH3PR11MB7896.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2025 14:44:22.7219 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AnYs+k/RkLTqI7RYPSe63jgoBVSTz5GlZcivqPEeLtzG9VEv7LVOB7IL8RpWO3+reh5vyZYoUXQBD8cwBIwWeMbYoTTeGS+2ZUcli/hxhys= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB6381 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDE0MDExMSBTYWx0ZWRfX6BAsmP7eAO2T A6rCqN/Xs2N3KUGQXrxMbYiyd6CwfUL+JPsSV/m7FhE4HzuDrPIaWXObmA97DuoAF0KoRfjfFWD Be0yA8ko7xf82v9ZUWczTlRZuwWnCR+rmcaR5NYP0+A9sasYonobcvViOajiHXpLDXg9Jfx3CKI VldZ33J3y8Ae0RThWQSvuaEKAbFF6RDHk3wt9hMk7XJq9mmQ3aSuHv2poItXapELwM9lI6JE+jj DHgJMzg1luRjCRvpxUQ091ECB+dOCKxtYpdZRtGjMmKMXB1oI2GOqpOnsdFlc3Y6ojxOa8kRY/A bMv0DG4Iub/fyqmSFrpeBqqeV80m6gxCYCHlljmp5BEnNTni068naZvLRVvFVwfWy+H3wIKhobm 2hyM3whvufcPOQZLU08FzG/Ai0oxWA== X-Proofpoint-GUID: 46uB2MbE8esROVbAisx0QThJopd_4x1h X-Authority-Analysis: v=2.4 cv=JaKxbEKV c=1 sm=1 tr=0 ts=68ee61c8 cx=c_pps a=9FihqjIFmhICW6KbYStfAA==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=CCpqsmhAAAAA:8 a=t7CeM3EgAAAA:8 a=AHBuqsJtKLcTM1Vxm4AA:9 a=KZ1sBYSHuZW9YS6h:21 a=ul9cdbp4aOFLsgKbc677:22 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-ORIG-GUID: 46uB2MbE8esROVbAisx0QThJopd_4x1h X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-14_03,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 adultscore=0 phishscore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510020000 definitions=main-2510140111 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 14 Oct 2025 14:44:30 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224822 From: Sunil Dora To facilitate a clean backport of the full 10-commit series addressing the pthread condition variable lost wakeup issue (BZ#25847) in glibc 2.35, remove the existing 8 patches that were applied as a partial backport. The previous partial backport excluded commit: c36fc50781995e6758cae2b6927839d0157f213c ("nptl: Remove g_refs from condition variables") based on guidance from glibc maintainer Florian Weimer(#comment #74) This exclusion was recommended for stable branches to avoid altering the layout of pthread_cond_t, which could introduce ABI incompatibilities. Additionally, the dependent commit dbc5a50d12eff4cb3f782129029d04b8a76f58e7 was not needed in the partial backport. To align with upstream mainline, per maintainer Carlos O'Donell (comment #75), apply the complete 10-commit series for consistency. By removing these patches first, we ensure the subsequent application of the full 10 commits results in cleaner, more reviewable changes without intermixed conflicts or overlaps. Removed patches and corresponding upstream commits: - 0026-PR25847-1.patch: 1db84775f831a1494993ce9c118deaf9537cc50a - 0026-PR25847-2.patch: 0cc973160c23bb67f895bc887dd6942d29f8fee3 - 0026-PR25847-3.patch: b42cc6af11062c260c7dfa91f1c89891366fed3e - 0026-PR25847-4.patch: 4f7b051f8ee3feff1b53b27a906f245afaa9cee1 - 0026-PR25847-5.patch: 929a4764ac90382616b6a21f099192b2475da674 - 0026-PR25847-6.patch: ee6c14ed59d480720721aaacc5fb03213dc153da - 0026-PR25847-7.patch: 4b79e27a5073c02f6bff9aa8f4791230a0ab1867 - 0026-PR25847-8.patch: 91bb902f58264a2fd50fbce8f39a9a290dd23706 Bug reference: https://sourceware.org/bugzilla/show_bug.cgi?id=25847 This change prepares the branch for the full backport in follow-up commits. Signed-off-by: Sunil Dora --- .../glibc/glibc/0026-PR25847-1.patch | 455 ------------------ .../glibc/glibc/0026-PR25847-2.patch | 144 ------ .../glibc/glibc/0026-PR25847-3.patch | 77 --- .../glibc/glibc/0026-PR25847-4.patch | 117 ----- .../glibc/glibc/0026-PR25847-5.patch | 105 ---- .../glibc/glibc/0026-PR25847-6.patch | 169 ------- .../glibc/glibc/0026-PR25847-7.patch | 160 ------ .../glibc/glibc/0026-PR25847-8.patch | 192 -------- meta/recipes-core/glibc/glibc_2.35.bb | 8 - 9 files changed, 1427 deletions(-) delete mode 100644 meta/recipes-core/glibc/glibc/0026-PR25847-1.patch delete mode 100644 meta/recipes-core/glibc/glibc/0026-PR25847-2.patch delete mode 100644 meta/recipes-core/glibc/glibc/0026-PR25847-3.patch delete mode 100644 meta/recipes-core/glibc/glibc/0026-PR25847-4.patch delete mode 100644 meta/recipes-core/glibc/glibc/0026-PR25847-5.patch delete mode 100644 meta/recipes-core/glibc/glibc/0026-PR25847-6.patch delete mode 100644 meta/recipes-core/glibc/glibc/0026-PR25847-7.patch delete mode 100644 meta/recipes-core/glibc/glibc/0026-PR25847-8.patch diff --git a/meta/recipes-core/glibc/glibc/0026-PR25847-1.patch b/meta/recipes-core/glibc/glibc/0026-PR25847-1.patch deleted file mode 100644 index 44a2b6772c..0000000000 --- a/meta/recipes-core/glibc/glibc/0026-PR25847-1.patch +++ /dev/null @@ -1,455 +0,0 @@ -From 31d9848830e496f57d4182b518467c4c63bfd4bd Mon Sep 17 00:00:00 2001 -From: Frank Barrus -Date: Mon, 16 Jun 2025 22:37:54 -0700 -Subject: [PATCH] pthreads NPTL: lost wakeup fix 2 - -This fixes the lost wakeup (from a bug in signal stealing) with a change -in the usage of g_signals[] in the condition variable internal state. -It also completely eliminates the concept and handling of signal stealing, -as well as the need for signalers to block to wait for waiters to wake -up every time there is a G1/G2 switch. This greatly reduces the average -and maximum latency for pthread_cond_signal. - -The g_signals[] field now contains a signal count that is relative to -the current g1_start value. Since it is a 32-bit field, and the LSB is -still reserved (though not currently used anymore), it has a 31-bit value -that corresponds to the low 31 bits of the sequence number in g1_start. -(since g1_start also has an LSB flag, this means bits 31:1 in g_signals -correspond to bits 31:1 in g1_start, plus the current signal count) - -By making the signal count relative to g1_start, there is no longer -any ambiguity or A/B/A issue, and thus any checks before blocking, -including the futex call itself, are guaranteed not to block if the G1/G2 -switch occurs, even if the signal count remains the same. This allows -initially safely blocking in G2 until the switch to G1 occurs, and -then transitioning from G1 to a new G1 or G2, and always being able to -distinguish the state change. This removes the race condition and A/B/A -problems that otherwise ocurred if a late (pre-empted) waiter were to -resume just as the futex call attempted to block on g_signal since -otherwise there was no last opportunity to re-check things like whether -the current G1 group was already closed. - -By fixing these issues, the signal stealing code can be eliminated, -since there is no concept of signal stealing anymore. The code to block -for all waiters to exit g_refs can also be removed, since any waiters -that are still in the g_refs region can be guaranteed to safely wake -up and exit. If there are still any left at this time, they are all -sent one final futex wakeup to ensure that they are not blocked any -longer, but there is no need for the signaller to block and wait for -them to wake up and exit the g_refs region. - -The signal count is then effectively "zeroed" but since it is now -relative to g1_start, this is done by advancing it to a new value that -can be observed by any pending blocking waiters. Any late waiters can -always tell the difference, and can thus just cleanly exit if they are -in a stale G1 or G2. They can never steal a signal from the current -G1 if they are not in the current G1, since the signal value that has -to match in the cmpxchg has the low 31 bits of the g1_start value -contained in it, and that's first checked, and then it won't match if -there's a G1/G2 change. - -Note: the 31-bit sequence number used in g_signals is designed to -handle wrap-around when checking the signal count, but if the entire -31-bit wraparound (2 billion signals) occurs while there is still a -late waiter that has not yet resumed, and it happens to then match -the current g1_start low bits, and the pre-emption occurs after the -normal "closed group" checks (which are 64-bit) but then hits the -futex syscall and signal consuming code, then an A/B/A issue could -still result and cause an incorrect assumption about whether it -should block. This particular scenario seems unlikely in practice. -Note that once awake from the futex, the waiter would notice the -closed group before consuming the signal (since that's still a 64-bit -check that would not be aliased in the wrap-around in g_signals), -so the biggest impact would be blocking on the futex until the next -full wakeup from a G1/G2 switch. - -The following commits have been cherry-picked from Glibc master branch: -Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 - -Upstream-Status: Backport -[https://sourceware.org/git/?p=glibc.git;a=commit;h=1db84775f831a1494993ce9c118deaf9537cc50a] - -Signed-off-by: Sunil Dora ---- - nptl/pthread_cond_common.c | 106 +++++++++------------------ - nptl/pthread_cond_wait.c | 144 ++++++++++++------------------------- - 2 files changed, 81 insertions(+), 169 deletions(-) - -diff --git a/nptl/pthread_cond_common.c b/nptl/pthread_cond_common.c -index fb035f72c3..8dd7037923 100644 ---- a/nptl/pthread_cond_common.c -+++ b/nptl/pthread_cond_common.c -@@ -201,7 +201,6 @@ static bool __attribute__ ((unused)) - __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq, - unsigned int *g1index, int private) - { -- const unsigned int maxspin = 0; - unsigned int g1 = *g1index; - - /* If there is no waiter in G2, we don't do anything. The expression may -@@ -222,85 +221,46 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq, - * New waiters arriving concurrently with the group switching will all go - into G2 until we atomically make the switch. Waiters existing in G2 - are not affected. -- * Waiters in G1 will be closed out immediately by setting a flag in -- __g_signals, which will prevent waiters from blocking using a futex on -- __g_signals and also notifies them that the group is closed. As a -- result, they will eventually remove their group reference, allowing us -- to close switch group roles. */ -- -- /* First, set the closed flag on __g_signals. This tells waiters that are -- about to wait that they shouldn't do that anymore. This basically -- serves as an advance notificaton of the upcoming change to __g1_start; -- waiters interpret it as if __g1_start was larger than their waiter -- sequence position. This allows us to change __g1_start after waiting -- for all existing waiters with group references to leave, which in turn -- makes recovery after stealing a signal simpler because it then can be -- skipped if __g1_start indicates that the group is closed (otherwise, -- we would have to recover always because waiters don't know how big their -- groups are). Relaxed MO is fine. */ -- atomic_fetch_or_relaxed (cond->__data.__g_signals + g1, 1); -- -- /* Wait until there are no group references anymore. The fetch-or operation -- injects us into the modification order of __g_refs; release MO ensures -- that waiters incrementing __g_refs after our fetch-or see the previous -- changes to __g_signals and to __g1_start that had to happen before we can -- switch this G1 and alias with an older group (we have two groups, so -- aliasing requires switching group roles twice). Note that nobody else -- can have set the wake-request flag, so we do not have to act upon it. -- -- Also note that it is harmless if older waiters or waiters from this G1 -- get a group reference after we have quiesced the group because it will -- remain closed for them either because of the closed flag in __g_signals -- or the later update to __g1_start. New waiters will never arrive here -- but instead continue to go into the still current G2. */ -- unsigned r = atomic_fetch_or_release (cond->__data.__g_refs + g1, 0); -- while ((r >> 1) > 0) -- { -- for (unsigned int spin = maxspin; ((r >> 1) > 0) && (spin > 0); spin--) -- { -- /* TODO Back off. */ -- r = atomic_load_relaxed (cond->__data.__g_refs + g1); -- } -- if ((r >> 1) > 0) -- { -- /* There is still a waiter after spinning. Set the wake-request -- flag and block. Relaxed MO is fine because this is just about -- this futex word. -- -- Update r to include the set wake-request flag so that the upcoming -- futex_wait only blocks if the flag is still set (otherwise, we'd -- violate the basic client-side futex protocol). */ -- r = atomic_fetch_or_relaxed (cond->__data.__g_refs + g1, 1) | 1; -- -- if ((r >> 1) > 0) -- futex_wait_simple (cond->__data.__g_refs + g1, r, private); -- /* Reload here so we eventually see the most recent value even if we -- do not spin. */ -- r = atomic_load_relaxed (cond->__data.__g_refs + g1); -- } -- } -- /* Acquire MO so that we synchronize with the release operation that waiters -- use to decrement __g_refs and thus happen after the waiters we waited -- for. */ -- atomic_thread_fence_acquire (); -+ * Waiters in G1 will be closed out immediately by the advancing of -+ __g_signals to the next "lowseq" (low 31 bits of the new g1_start), -+ which will prevent waiters from blocking using a futex on -+ __g_signals since it provides enough signals for all possible -+ remaining waiters. As a result, they can each consume a signal -+ and they will eventually remove their group reference. */ - - /* Update __g1_start, which finishes closing this group. The value we add - will never be negative because old_orig_size can only be zero when we - switch groups the first time after a condvar was initialized, in which -- case G1 will be at index 1 and we will add a value of 1. See above for -- why this takes place after waiting for quiescence of the group. -+ case G1 will be at index 1 and we will add a value of 1. - Relaxed MO is fine because the change comes with no additional - constraints that others would have to observe. */ - __condvar_add_g1_start_relaxed (cond, - (old_orig_size << 1) + (g1 == 1 ? 1 : - 1)); - -- /* Now reopen the group, thus enabling waiters to again block using the -- futex controlled by __g_signals. Release MO so that observers that see -- no signals (and thus can block) also see the write __g1_start and thus -- that this is now a new group (see __pthread_cond_wait_common for the -- matching acquire MO loads). */ -- atomic_store_release (cond->__data.__g_signals + g1, 0); -- -+ unsigned int lowseq = ((old_g1_start + old_orig_size) << 1) & ~1U; -+ -+ /* If any waiters still hold group references (and thus could be blocked), -+ then wake them all up now and prevent any running ones from blocking. -+ This is effectively a catch-all for any possible current or future -+ bugs that can allow the group size to reach 0 before all G1 waiters -+ have been awakened or at least given signals to consume, or any -+ other case that can leave blocked (or about to block) older waiters.. */ -+ if ((atomic_fetch_or_release (cond->__data.__g_refs + g1, 0) >> 1) > 0) -+ { -+ /* First advance signals to the end of the group (i.e. enough signals -+ for the entire G1 group) to ensure that waiters which have not -+ yet blocked in the futex will not block. -+ Note that in the vast majority of cases, this should never -+ actually be necessary, since __g_signals will have enough -+ signals for the remaining g_refs waiters. As an optimization, -+ we could check this first before proceeding, although that -+ could still leave the potential for futex lost wakeup bugs -+ if the signal count was non-zero but the futex wakeup -+ was somehow lost. */ -+ atomic_store_release (cond->__data.__g_signals + g1, lowseq); -+ -+ futex_wake (cond->__data.__g_signals + g1, INT_MAX, private); -+ } - /* At this point, the old G1 is now a valid new G2 (but not in use yet). - No old waiter can neither grab a signal nor acquire a reference without - noticing that __g1_start is larger. -@@ -311,6 +271,10 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq, - g1 ^= 1; - *g1index ^= 1; - -+ /* Now advance the new G1 g_signals to the new lowseq, giving it -+ an effective signal count of 0 to start. */ -+ atomic_store_release (cond->__data.__g_signals + g1, lowseq); -+ - /* These values are just observed by signalers, and thus protected by the - lock. */ - unsigned int orig_size = wseq - (old_g1_start + old_orig_size); -diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c -index 20c348a503..1cb3dbf7b0 100644 ---- a/nptl/pthread_cond_wait.c -+++ b/nptl/pthread_cond_wait.c -@@ -238,9 +238,7 @@ __condvar_cleanup_waiting (void *arg) - signaled), and a reference count. - - The group reference count is used to maintain the number of waiters that -- are using the group's futex. Before a group can change its role, the -- reference count must show that no waiters are using the futex anymore; this -- prevents ABA issues on the futex word. -+ are using the group's futex. - - To represent which intervals in the waiter sequence the groups cover (and - thus also which group slot contains G1 or G2), we use a 64b counter to -@@ -300,11 +298,12 @@ __condvar_cleanup_waiting (void *arg) - last reference. - * Reference count used by waiters concurrently with signalers that have - acquired the condvar-internal lock. -- __g_signals: The number of signals that can still be consumed. -+ __g_signals: The number of signals that can still be consumed, relative to -+ the current g1_start. (i.e. bits 31 to 1 of __g_signals are bits -+ 31 to 1 of g1_start with the signal count added) - * Used as a futex word by waiters. Used concurrently by waiters and - signalers. -- * LSB is true iff this group has been completely signaled (i.e., it is -- closed). -+ * LSB is currently reserved and 0. - __g_size: Waiters remaining in this group (i.e., which have not been - signaled yet. - * Accessed by signalers and waiters that cancel waiting (both do so only -@@ -328,18 +327,6 @@ __condvar_cleanup_waiting (void *arg) - sufficient because if a waiter can see a sufficiently large value, it could - have also consume a signal in the waiters group. - -- Waiters try to grab a signal from __g_signals without holding a reference -- count, which can lead to stealing a signal from a more recent group after -- their own group was already closed. They cannot always detect whether they -- in fact did because they do not know when they stole, but they can -- conservatively add a signal back to the group they stole from; if they -- did so unnecessarily, all that happens is a spurious wake-up. To make this -- even less likely, __g1_start contains the index of the current g2 too, -- which allows waiters to check if there aliasing on the group slots; if -- there wasn't, they didn't steal from the current G1, which means that the -- G1 they stole from must have been already closed and they do not need to -- fix anything. -- - It is essential that the last field in pthread_cond_t is __g_signals[1]: - The previous condvar used a pointer-sized field in pthread_cond_t, so a - PTHREAD_COND_INITIALIZER from that condvar implementation might only -@@ -435,6 +422,9 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - { - while (1) - { -+ uint64_t g1_start = __condvar_load_g1_start_relaxed (cond); -+ unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; -+ - /* Spin-wait first. - Note that spinning first without checking whether a timeout - passed might lead to what looks like a spurious wake-up even -@@ -446,35 +436,45 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - having to compare against the current time seems to be the right - choice from a performance perspective for most use cases. */ - unsigned int spin = maxspin; -- while (signals == 0 && spin > 0) -+ while (spin > 0 && ((int)(signals - lowseq) < 2)) - { - /* Check that we are not spinning on a group that's already - closed. */ -- if (seq < (__condvar_load_g1_start_relaxed (cond) >> 1)) -- goto done; -+ if (seq < (g1_start >> 1)) -+ break; - - /* TODO Back off. */ - - /* Reload signals. See above for MO. */ - signals = atomic_load_acquire (cond->__data.__g_signals + g); -+ g1_start = __condvar_load_g1_start_relaxed (cond); -+ lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; - spin--; - } - -- /* If our group will be closed as indicated by the flag on signals, -- don't bother grabbing a signal. */ -- if (signals & 1) -- goto done; -- -- /* If there is an available signal, don't block. */ -- if (signals != 0) -+ if (seq < (g1_start >> 1)) -+ { -+ /* If the group is closed already, -+ then this waiter originally had enough extra signals to -+ consume, up until the time its group was closed. */ -+ goto done; -+ } -+ -+ /* If there is an available signal, don't block. -+ If __g1_start has advanced at all, then we must be in G1 -+ by now, perhaps in the process of switching back to an older -+ G2, but in either case we're allowed to consume the available -+ signal and should not block anymore. */ -+ if ((int)(signals - lowseq) >= 2) - break; - - /* No signals available after spinning, so prepare to block. - We first acquire a group reference and use acquire MO for that so - that we synchronize with the dummy read-modify-write in - __condvar_quiesce_and_switch_g1 if we read from that. In turn, -- in this case this will make us see the closed flag on __g_signals -- that designates a concurrent attempt to reuse the group's slot. -+ in this case this will make us see the advancement of __g_signals -+ to the upcoming new g1_start that occurs with a concurrent -+ attempt to reuse the group's slot. - We use acquire MO for the __g_signals check to make the - __g1_start check work (see spinning above). - Note that the group reference acquisition will not mask the -@@ -482,15 +482,24 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - an atomic read-modify-write operation and thus extend the release - sequence. */ - atomic_fetch_add_acquire (cond->__data.__g_refs + g, 2); -- if (((atomic_load_acquire (cond->__data.__g_signals + g) & 1) != 0) -- || (seq < (__condvar_load_g1_start_relaxed (cond) >> 1))) -+ signals = atomic_load_acquire (cond->__data.__g_signals + g); -+ g1_start = __condvar_load_g1_start_relaxed (cond); -+ lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; -+ -+ if (seq < (g1_start >> 1)) - { -- /* Our group is closed. Wake up any signalers that might be -- waiting. */ -+ /* group is closed already, so don't block */ - __condvar_dec_grefs (cond, g, private); - goto done; - } - -+ if ((int)(signals - lowseq) >= 2) -+ { -+ /* a signal showed up or G1/G2 switched after we grabbed the refcount */ -+ __condvar_dec_grefs (cond, g, private); -+ break; -+ } -+ - // Now block. - struct _pthread_cleanup_buffer buffer; - struct _condvar_cleanup_buffer cbuffer; -@@ -501,7 +510,7 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - __pthread_cleanup_push (&buffer, __condvar_cleanup_waiting, &cbuffer); - - err = __futex_abstimed_wait_cancelable64 ( -- cond->__data.__g_signals + g, 0, clockid, abstime, private); -+ cond->__data.__g_signals + g, signals, clockid, abstime, private); - - __pthread_cleanup_pop (&buffer, 0); - -@@ -524,6 +533,8 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - signals = atomic_load_acquire (cond->__data.__g_signals + g); - } - -+ if (seq < (__condvar_load_g1_start_relaxed (cond) >> 1)) -+ goto done; - } - /* Try to grab a signal. Use acquire MO so that we see an up-to-date value - of __g1_start below (see spinning above for a similar case). In -@@ -532,69 +543,6 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - while (!atomic_compare_exchange_weak_acquire (cond->__data.__g_signals + g, - &signals, signals - 2)); - -- /* We consumed a signal but we could have consumed from a more recent group -- that aliased with ours due to being in the same group slot. If this -- might be the case our group must be closed as visible through -- __g1_start. */ -- uint64_t g1_start = __condvar_load_g1_start_relaxed (cond); -- if (seq < (g1_start >> 1)) -- { -- /* We potentially stole a signal from a more recent group but we do not -- know which group we really consumed from. -- We do not care about groups older than current G1 because they are -- closed; we could have stolen from these, but then we just add a -- spurious wake-up for the current groups. -- We will never steal a signal from current G2 that was really intended -- for G2 because G2 never receives signals (until it becomes G1). We -- could have stolen a signal from G2 that was conservatively added by a -- previous waiter that also thought it stole a signal -- but given that -- that signal was added unnecessarily, it's not a problem if we steal -- it. -- Thus, the remaining case is that we could have stolen from the current -- G1, where "current" means the __g1_start value we observed. However, -- if the current G1 does not have the same slot index as we do, we did -- not steal from it and do not need to undo that. This is the reason -- for putting a bit with G2's index into__g1_start as well. */ -- if (((g1_start & 1) ^ 1) == g) -- { -- /* We have to conservatively undo our potential mistake of stealing -- a signal. We can stop trying to do that when the current G1 -- changes because other spinning waiters will notice this too and -- __condvar_quiesce_and_switch_g1 has checked that there are no -- futex waiters anymore before switching G1. -- Relaxed MO is fine for the __g1_start load because we need to -- merely be able to observe this fact and not have to observe -- something else as well. -- ??? Would it help to spin for a little while to see whether the -- current G1 gets closed? This might be worthwhile if the group is -- small or close to being closed. */ -- unsigned int s = atomic_load_relaxed (cond->__data.__g_signals + g); -- while (__condvar_load_g1_start_relaxed (cond) == g1_start) -- { -- /* Try to add a signal. We don't need to acquire the lock -- because at worst we can cause a spurious wake-up. If the -- group is in the process of being closed (LSB is true), this -- has an effect similar to us adding a signal. */ -- if (((s & 1) != 0) -- || atomic_compare_exchange_weak_relaxed -- (cond->__data.__g_signals + g, &s, s + 2)) -- { -- /* If we added a signal, we also need to add a wake-up on -- the futex. We also need to do that if we skipped adding -- a signal because the group is being closed because -- while __condvar_quiesce_and_switch_g1 could have closed -- the group, it might stil be waiting for futex waiters to -- leave (and one of those waiters might be the one we stole -- the signal from, which cause it to block using the -- futex). */ -- futex_wake (cond->__data.__g_signals + g, 1, private); -- break; -- } -- /* TODO Back off. */ -- } -- } -- } -- - done: - - /* Confirm that we have been woken. We do that before acquiring the mutex --- -2.49.0 - diff --git a/meta/recipes-core/glibc/glibc/0026-PR25847-2.patch b/meta/recipes-core/glibc/glibc/0026-PR25847-2.patch deleted file mode 100644 index cb89431769..0000000000 --- a/meta/recipes-core/glibc/glibc/0026-PR25847-2.patch +++ /dev/null @@ -1,144 +0,0 @@ -From 6aab1191e35a3da66e8c49d95178a9d77c119a1f Mon Sep 17 00:00:00 2001 -From: Malte Skarupke -Date: Mon, 16 Jun 2025 23:17:53 -0700 -Subject: [PATCH] nptl: Update comments and indentation for new condvar - implementation - -Some comments were wrong after the most recent commit. This fixes that. -Also fixing indentation where it was using spaces instead of tabs. - -The following commits have been cherry-picked from Glibc master branch: -Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 - -Upstream-Status: Backport -[https://sourceware.org/git/?p=glibc.git;a=commit;h=0cc973160c23bb67f895bc887dd6942d29f8fee3] - -Signed-off-by: Sunil Dora ---- - nptl/pthread_cond_common.c | 5 +++-- - nptl/pthread_cond_wait.c | 39 +++++++++++++++++++------------------- - 2 files changed, 22 insertions(+), 22 deletions(-) - -diff --git a/nptl/pthread_cond_common.c b/nptl/pthread_cond_common.c -index 8dd7037923..306a207dd6 100644 ---- a/nptl/pthread_cond_common.c -+++ b/nptl/pthread_cond_common.c -@@ -221,8 +221,9 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq, - * New waiters arriving concurrently with the group switching will all go - into G2 until we atomically make the switch. Waiters existing in G2 - are not affected. -- * Waiters in G1 will be closed out immediately by the advancing of -- __g_signals to the next "lowseq" (low 31 bits of the new g1_start), -+ * Waiters in G1 have already received a signal and been woken. If they -+ haven't woken yet, they will be closed out immediately by the advancing -+ of __g_signals to the next "lowseq" (low 31 bits of the new g1_start), - which will prevent waiters from blocking using a futex on - __g_signals since it provides enough signals for all possible - remaining waiters. As a result, they can each consume a signal -diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c -index 1cb3dbf7b0..cee1968756 100644 ---- a/nptl/pthread_cond_wait.c -+++ b/nptl/pthread_cond_wait.c -@@ -249,7 +249,7 @@ __condvar_cleanup_waiting (void *arg) - figure out whether they are in a group that has already been completely - signaled (i.e., if the current G1 starts at a later position that the - waiter's position). Waiters cannot determine whether they are currently -- in G2 or G1 -- but they do not have too because all they are interested in -+ in G2 or G1 -- but they do not have to because all they are interested in - is whether there are available signals, and they always start in G2 (whose - group slot they know because of the bit in the waiter sequence. Signalers - will simply fill the right group until it is completely signaled and can -@@ -412,7 +412,7 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - } - - /* Now wait until a signal is available in our group or it is closed. -- Acquire MO so that if we observe a value of zero written after group -+ Acquire MO so that if we observe (signals == lowseq) after group - switching in __condvar_quiesce_and_switch_g1, we synchronize with that - store and will see the prior update of __g1_start done while switching - groups too. */ -@@ -422,8 +422,8 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - { - while (1) - { -- uint64_t g1_start = __condvar_load_g1_start_relaxed (cond); -- unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; -+ uint64_t g1_start = __condvar_load_g1_start_relaxed (cond); -+ unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; - - /* Spin-wait first. - Note that spinning first without checking whether a timeout -@@ -447,21 +447,21 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - - /* Reload signals. See above for MO. */ - signals = atomic_load_acquire (cond->__data.__g_signals + g); -- g1_start = __condvar_load_g1_start_relaxed (cond); -- lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; -+ g1_start = __condvar_load_g1_start_relaxed (cond); -+ lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; - spin--; - } - -- if (seq < (g1_start >> 1)) -+ if (seq < (g1_start >> 1)) - { -- /* If the group is closed already, -+ /* If the group is closed already, - then this waiter originally had enough extra signals to - consume, up until the time its group was closed. */ - goto done; -- } -+ } - - /* If there is an available signal, don't block. -- If __g1_start has advanced at all, then we must be in G1 -+ If __g1_start has advanced at all, then we must be in G1 - by now, perhaps in the process of switching back to an older - G2, but in either case we're allowed to consume the available - signal and should not block anymore. */ -@@ -483,22 +483,23 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - sequence. */ - atomic_fetch_add_acquire (cond->__data.__g_refs + g, 2); - signals = atomic_load_acquire (cond->__data.__g_signals + g); -- g1_start = __condvar_load_g1_start_relaxed (cond); -- lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; -+ g1_start = __condvar_load_g1_start_relaxed (cond); -+ lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; - -- if (seq < (g1_start >> 1)) -+ if (seq < (g1_start >> 1)) - { -- /* group is closed already, so don't block */ -+ /* group is closed already, so don't block */ - __condvar_dec_grefs (cond, g, private); - goto done; - } - - if ((int)(signals - lowseq) >= 2) - { -- /* a signal showed up or G1/G2 switched after we grabbed the refcount */ -+ /* a signal showed up or G1/G2 switched after we grabbed the -+ refcount */ - __condvar_dec_grefs (cond, g, private); - break; -- } -+ } - - // Now block. - struct _pthread_cleanup_buffer buffer; -@@ -536,10 +537,8 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - if (seq < (__condvar_load_g1_start_relaxed (cond) >> 1)) - goto done; - } -- /* Try to grab a signal. Use acquire MO so that we see an up-to-date value -- of __g1_start below (see spinning above for a similar case). In -- particular, if we steal from a more recent group, we will also see a -- more recent __g1_start below. */ -+ /* Try to grab a signal. See above for MO. (if we do another loop -+ iteration we need to see the correct value of g1_start) */ - while (!atomic_compare_exchange_weak_acquire (cond->__data.__g_signals + g, - &signals, signals - 2)); - --- -2.49.0 - diff --git a/meta/recipes-core/glibc/glibc/0026-PR25847-3.patch b/meta/recipes-core/glibc/glibc/0026-PR25847-3.patch deleted file mode 100644 index 4cfcca846c..0000000000 --- a/meta/recipes-core/glibc/glibc/0026-PR25847-3.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 28a5082045429fdc5a4744d45fdc5b5202528eaa Mon Sep 17 00:00:00 2001 -From: Malte Skarupke -Date: Mon, 16 Jun 2025 23:29:49 -0700 -Subject: [PATCH] nptl: Remove unnecessary catch-all-wake in condvar group - switch - -This wake is unnecessary. We only switch groups after every sleeper in a group -has been woken. Sure, they may take a while to actually wake up and may still -hold a reference, but waking them a second time doesn't speed that up. Instead -this just makes the code more complicated and may hide problems. - -In particular this safety wake wouldn't even have helped with the bug that was -fixed by Barrus' patch: The bug there was that pthread_cond_signal would not -switch g1 when it should, so we wouldn't even have entered this code path. - -The following commits have been cherry-picked from Glibc master branch: -Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 - -Upstream-Status: Backport -[https://sourceware.org/git/?p=glibc.git;a=commit;h=b42cc6af11062c260c7dfa91f1c89891366fed3e] - -Signed-off-by: Sunil Dora ---- - nptl/pthread_cond_common.c | 30 +----------------------------- - 1 file changed, 1 insertion(+), 29 deletions(-) - -diff --git a/nptl/pthread_cond_common.c b/nptl/pthread_cond_common.c -index 306a207dd6..f976a533a1 100644 ---- a/nptl/pthread_cond_common.c -+++ b/nptl/pthread_cond_common.c -@@ -221,13 +221,7 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq, - * New waiters arriving concurrently with the group switching will all go - into G2 until we atomically make the switch. Waiters existing in G2 - are not affected. -- * Waiters in G1 have already received a signal and been woken. If they -- haven't woken yet, they will be closed out immediately by the advancing -- of __g_signals to the next "lowseq" (low 31 bits of the new g1_start), -- which will prevent waiters from blocking using a futex on -- __g_signals since it provides enough signals for all possible -- remaining waiters. As a result, they can each consume a signal -- and they will eventually remove their group reference. */ -+ * Waiters in G1 have already received a signal and been woken. */ - - /* Update __g1_start, which finishes closing this group. The value we add - will never be negative because old_orig_size can only be zero when we -@@ -240,28 +234,6 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq, - - unsigned int lowseq = ((old_g1_start + old_orig_size) << 1) & ~1U; - -- /* If any waiters still hold group references (and thus could be blocked), -- then wake them all up now and prevent any running ones from blocking. -- This is effectively a catch-all for any possible current or future -- bugs that can allow the group size to reach 0 before all G1 waiters -- have been awakened or at least given signals to consume, or any -- other case that can leave blocked (or about to block) older waiters.. */ -- if ((atomic_fetch_or_release (cond->__data.__g_refs + g1, 0) >> 1) > 0) -- { -- /* First advance signals to the end of the group (i.e. enough signals -- for the entire G1 group) to ensure that waiters which have not -- yet blocked in the futex will not block. -- Note that in the vast majority of cases, this should never -- actually be necessary, since __g_signals will have enough -- signals for the remaining g_refs waiters. As an optimization, -- we could check this first before proceeding, although that -- could still leave the potential for futex lost wakeup bugs -- if the signal count was non-zero but the futex wakeup -- was somehow lost. */ -- atomic_store_release (cond->__data.__g_signals + g1, lowseq); -- -- futex_wake (cond->__data.__g_signals + g1, INT_MAX, private); -- } - /* At this point, the old G1 is now a valid new G2 (but not in use yet). - No old waiter can neither grab a signal nor acquire a reference without - noticing that __g1_start is larger. --- -2.49.0 - diff --git a/meta/recipes-core/glibc/glibc/0026-PR25847-4.patch b/meta/recipes-core/glibc/glibc/0026-PR25847-4.patch deleted file mode 100644 index f8674d62ae..0000000000 --- a/meta/recipes-core/glibc/glibc/0026-PR25847-4.patch +++ /dev/null @@ -1,117 +0,0 @@ -From 16b9af737c77b153fca4f36cbdbe94f7416c0b42 Mon Sep 17 00:00:00 2001 -From: Malte Skarupke -Date: Mon, 16 Jun 2025 23:38:40 -0700 -Subject: [PATCH] nptl: Remove unnecessary quadruple check in pthread_cond_wait - -pthread_cond_wait was checking whether it was in a closed group no less than -four times. Checking once is enough. Here are the four checks: - -1. While spin-waiting. This was dead code: maxspin is set to 0 and has been - for years. -2. Before deciding to go to sleep, and before incrementing grefs: I kept this -3. After incrementing grefs. There is no reason to think that the group would - close while we do an atomic increment. Obviously it could close at any - point, but that doesn't mean we have to recheck after every step. This - check was equally good as check 2, except it has to do more work. -4. When we find ourselves in a group that has a signal. We only get here after - we check that we're not in a closed group. There is no need to check again. - The check would only have helped in cases where the compare_exchange in the - next line would also have failed. Relying on the compare_exchange is fine. - -Removing the duplicate checks clarifies the code. - -The following commits have been cherry-picked from Glibc master branch: -Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 - -Upstream-Status: Backport -[https://sourceware.org/git/?p=glibc.git;a=commit;h=4f7b051f8ee3feff1b53b27a906f245afaa9cee1] - -Signed-off-by: Sunil Dora ---- - nptl/pthread_cond_wait.c | 49 ---------------------------------------- - 1 file changed, 49 deletions(-) - -diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c -index cee1968756..47e834cade 100644 ---- a/nptl/pthread_cond_wait.c -+++ b/nptl/pthread_cond_wait.c -@@ -366,7 +366,6 @@ static __always_inline int - __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - clockid_t clockid, const struct __timespec64 *abstime) - { -- const int maxspin = 0; - int err; - int result = 0; - -@@ -425,33 +424,6 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - uint64_t g1_start = __condvar_load_g1_start_relaxed (cond); - unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; - -- /* Spin-wait first. -- Note that spinning first without checking whether a timeout -- passed might lead to what looks like a spurious wake-up even -- though we should return ETIMEDOUT (e.g., if the caller provides -- an absolute timeout that is clearly in the past). However, -- (1) spurious wake-ups are allowed, (2) it seems unlikely that a -- user will (ab)use pthread_cond_wait as a check for whether a -- point in time is in the past, and (3) spinning first without -- having to compare against the current time seems to be the right -- choice from a performance perspective for most use cases. */ -- unsigned int spin = maxspin; -- while (spin > 0 && ((int)(signals - lowseq) < 2)) -- { -- /* Check that we are not spinning on a group that's already -- closed. */ -- if (seq < (g1_start >> 1)) -- break; -- -- /* TODO Back off. */ -- -- /* Reload signals. See above for MO. */ -- signals = atomic_load_acquire (cond->__data.__g_signals + g); -- g1_start = __condvar_load_g1_start_relaxed (cond); -- lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; -- spin--; -- } -- - if (seq < (g1_start >> 1)) - { - /* If the group is closed already, -@@ -482,24 +454,6 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - an atomic read-modify-write operation and thus extend the release - sequence. */ - atomic_fetch_add_acquire (cond->__data.__g_refs + g, 2); -- signals = atomic_load_acquire (cond->__data.__g_signals + g); -- g1_start = __condvar_load_g1_start_relaxed (cond); -- lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; -- -- if (seq < (g1_start >> 1)) -- { -- /* group is closed already, so don't block */ -- __condvar_dec_grefs (cond, g, private); -- goto done; -- } -- -- if ((int)(signals - lowseq) >= 2) -- { -- /* a signal showed up or G1/G2 switched after we grabbed the -- refcount */ -- __condvar_dec_grefs (cond, g, private); -- break; -- } - - // Now block. - struct _pthread_cleanup_buffer buffer; -@@ -533,9 +487,6 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - /* Reload signals. See above for MO. */ - signals = atomic_load_acquire (cond->__data.__g_signals + g); - } -- -- if (seq < (__condvar_load_g1_start_relaxed (cond) >> 1)) -- goto done; - } - /* Try to grab a signal. See above for MO. (if we do another loop - iteration we need to see the correct value of g1_start) */ --- -2.49.0 - diff --git a/meta/recipes-core/glibc/glibc/0026-PR25847-5.patch b/meta/recipes-core/glibc/glibc/0026-PR25847-5.patch deleted file mode 100644 index 16fe6f8460..0000000000 --- a/meta/recipes-core/glibc/glibc/0026-PR25847-5.patch +++ /dev/null @@ -1,105 +0,0 @@ -From d9ffb50dc55f77e584a5d0275eea758c7a6b04e3 Mon Sep 17 00:00:00 2001 -From: Malte Skarupke -Date: Mon, 16 Jun 2025 23:53:35 -0700 -Subject: [PATCH] nptl: Use a single loop in pthread_cond_wait instaed of a - nested loop - -The loop was a little more complicated than necessary. There was only one -break statement out of the inner loop, and the outer loop was nearly empty. -So just remove the outer loop, moving its code to the one break statement in -the inner loop. This allows us to replace all gotos with break statements. - -The following commits have been cherry-picked from Glibc master branch: -Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 - -Upstream-Status: Backport -[https://sourceware.org/git/?p=glibc.git;a=commit;h=929a4764ac90382616b6a21f099192b2475da674] - -Signed-off-by: Sunil Dora ---- - nptl/pthread_cond_wait.c | 41 +++++++++++++++++++--------------------- - 1 file changed, 19 insertions(+), 22 deletions(-) - -diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c -index 47e834cade..5c86880105 100644 ---- a/nptl/pthread_cond_wait.c -+++ b/nptl/pthread_cond_wait.c -@@ -410,17 +410,15 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - return err; - } - -- /* Now wait until a signal is available in our group or it is closed. -- Acquire MO so that if we observe (signals == lowseq) after group -- switching in __condvar_quiesce_and_switch_g1, we synchronize with that -- store and will see the prior update of __g1_start done while switching -- groups too. */ -- unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g); -- -- do -- { -+ - while (1) - { -+ /* Now wait until a signal is available in our group or it is closed. -+ Acquire MO so that if we observe (signals == lowseq) after group -+ switching in __condvar_quiesce_and_switch_g1, we synchronize with that -+ store and will see the prior update of __g1_start done while switching -+ groups too. */ -+ unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g); - uint64_t g1_start = __condvar_load_g1_start_relaxed (cond); - unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; - -@@ -429,7 +427,7 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - /* If the group is closed already, - then this waiter originally had enough extra signals to - consume, up until the time its group was closed. */ -- goto done; -+ break; - } - - /* If there is an available signal, don't block. -@@ -438,8 +436,16 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - G2, but in either case we're allowed to consume the available - signal and should not block anymore. */ - if ((int)(signals - lowseq) >= 2) -- break; -- -+ { -+ /* Try to grab a signal. See above for MO. (if we do another loop -+ iteration we need to see the correct value of g1_start) */ -+ if (atomic_compare_exchange_weak_acquire ( -+ cond->__data.__g_signals + g, -+ &signals, signals - 2)) -+ break; -+ else -+ continue; -+ } - /* No signals available after spinning, so prepare to block. - We first acquire a group reference and use acquire MO for that so - that we synchronize with the dummy read-modify-write in -@@ -479,21 +485,12 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - the lock during cancellation is not possible. */ - __condvar_cancel_waiting (cond, seq, g, private); - result = err; -- goto done; -+ break; - } - else - __condvar_dec_grefs (cond, g, private); - -- /* Reload signals. See above for MO. */ -- signals = atomic_load_acquire (cond->__data.__g_signals + g); - } -- } -- /* Try to grab a signal. See above for MO. (if we do another loop -- iteration we need to see the correct value of g1_start) */ -- while (!atomic_compare_exchange_weak_acquire (cond->__data.__g_signals + g, -- &signals, signals - 2)); -- -- done: - - /* Confirm that we have been woken. We do that before acquiring the mutex - to allow for execution of pthread_cond_destroy while having acquired the --- -2.49.0 - diff --git a/meta/recipes-core/glibc/glibc/0026-PR25847-6.patch b/meta/recipes-core/glibc/glibc/0026-PR25847-6.patch deleted file mode 100644 index cf87e21ddd..0000000000 --- a/meta/recipes-core/glibc/glibc/0026-PR25847-6.patch +++ /dev/null @@ -1,169 +0,0 @@ -From a2faee6d0dac6e5232255da9afda4d9ed6cfb6e5 Mon Sep 17 00:00:00 2001 -From: Malte Skarupke -Date: Tue, 17 Jun 2025 01:37:12 -0700 -Subject: [PATCH] nptl: Fix indentation - -In my previous change I turned a nested loop into a simple loop. I'm doing -the resulting indentation changes in a separate commit to make the diff on -the previous commit easier to review. - -The following commits have been cherry-picked from Glibc master branch: -Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 - -Upstream-Status: Backport -[https://sourceware.org/git/?p=glibc.git;a=commit;h=ee6c14ed59d480720721aaacc5fb03213dc153da] - -Signed-off-by: Sunil Dora ---- - nptl/pthread_cond_wait.c | 132 ++++++++++++++++----------------------- - 1 file changed, 54 insertions(+), 78 deletions(-) - -diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c -index 5c86880105..104ebd48ca 100644 ---- a/nptl/pthread_cond_wait.c -+++ b/nptl/pthread_cond_wait.c -@@ -410,87 +410,63 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - return err; - } - -- -- while (1) -- { -- /* Now wait until a signal is available in our group or it is closed. -- Acquire MO so that if we observe (signals == lowseq) after group -- switching in __condvar_quiesce_and_switch_g1, we synchronize with that -- store and will see the prior update of __g1_start done while switching -- groups too. */ -- unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g); -- uint64_t g1_start = __condvar_load_g1_start_relaxed (cond); -- unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; -- -- if (seq < (g1_start >> 1)) -- { -- /* If the group is closed already, -- then this waiter originally had enough extra signals to -- consume, up until the time its group was closed. */ -- break; -- } -- -- /* If there is an available signal, don't block. -- If __g1_start has advanced at all, then we must be in G1 -- by now, perhaps in the process of switching back to an older -- G2, but in either case we're allowed to consume the available -- signal and should not block anymore. */ -- if ((int)(signals - lowseq) >= 2) -- { -- /* Try to grab a signal. See above for MO. (if we do another loop -- iteration we need to see the correct value of g1_start) */ -- if (atomic_compare_exchange_weak_acquire ( -- cond->__data.__g_signals + g, -+ while (1) -+ { -+ /* Now wait until a signal is available in our group or it is closed. -+ Acquire MO so that if we observe (signals == lowseq) after group -+ switching in __condvar_quiesce_and_switch_g1, we synchronize with that -+ store and will see the prior update of __g1_start done while switching -+ groups too. */ -+ unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g); -+ uint64_t g1_start = __condvar_load_g1_start_relaxed (cond); -+ unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; -+ -+ if (seq < (g1_start >> 1)) -+ { -+ /* If the group is closed already, -+ then this waiter originally had enough extra signals to -+ consume, up until the time its group was closed. */ -+ break; -+ } -+ -+ /* If there is an available signal, don't block. -+ If __g1_start has advanced at all, then we must be in G1 -+ by now, perhaps in the process of switching back to an older -+ G2, but in either case we're allowed to consume the available -+ signal and should not block anymore. */ -+ if ((int)(signals - lowseq) >= 2) -+ { -+ /* Try to grab a signal. See above for MO. (if we do another loop -+ iteration we need to see the correct value of g1_start) */ -+ if (atomic_compare_exchange_weak_acquire ( -+ cond->__data.__g_signals + g, - &signals, signals - 2)) -- break; -- else -- continue; -- } -- /* No signals available after spinning, so prepare to block. -- We first acquire a group reference and use acquire MO for that so -- that we synchronize with the dummy read-modify-write in -- __condvar_quiesce_and_switch_g1 if we read from that. In turn, -- in this case this will make us see the advancement of __g_signals -- to the upcoming new g1_start that occurs with a concurrent -- attempt to reuse the group's slot. -- We use acquire MO for the __g_signals check to make the -- __g1_start check work (see spinning above). -- Note that the group reference acquisition will not mask the -- release MO when decrementing the reference count because we use -- an atomic read-modify-write operation and thus extend the release -- sequence. */ -- atomic_fetch_add_acquire (cond->__data.__g_refs + g, 2); -- -- // Now block. -- struct _pthread_cleanup_buffer buffer; -- struct _condvar_cleanup_buffer cbuffer; -- cbuffer.wseq = wseq; -- cbuffer.cond = cond; -- cbuffer.mutex = mutex; -- cbuffer.private = private; -- __pthread_cleanup_push (&buffer, __condvar_cleanup_waiting, &cbuffer); -- -- err = __futex_abstimed_wait_cancelable64 ( -- cond->__data.__g_signals + g, signals, clockid, abstime, private); -- -- __pthread_cleanup_pop (&buffer, 0); -- -- if (__glibc_unlikely (err == ETIMEDOUT || err == EOVERFLOW)) -- { -- __condvar_dec_grefs (cond, g, private); -- /* If we timed out, we effectively cancel waiting. Note that -- we have decremented __g_refs before cancellation, so that a -- deadlock between waiting for quiescence of our group in -- __condvar_quiesce_and_switch_g1 and us trying to acquire -- the lock during cancellation is not possible. */ -- __condvar_cancel_waiting (cond, seq, g, private); -- result = err; - break; -- } -- else -- __condvar_dec_grefs (cond, g, private); -- -+ else -+ continue; - } -+ // Now block. -+ struct _pthread_cleanup_buffer buffer; -+ struct _condvar_cleanup_buffer cbuffer; -+ cbuffer.wseq = wseq; -+ cbuffer.cond = cond; -+ cbuffer.mutex = mutex; -+ cbuffer.private = private; -+ __pthread_cleanup_push (&buffer, __condvar_cleanup_waiting, &cbuffer); -+ -+ err = __futex_abstimed_wait_cancelable64 ( -+ cond->__data.__g_signals + g, signals, clockid, abstime, private); -+ -+ __pthread_cleanup_pop (&buffer, 0); -+ -+ if (__glibc_unlikely (err == ETIMEDOUT || err == EOVERFLOW)) -+ { -+ /* If we timed out, we effectively cancel waiting. */ -+ __condvar_cancel_waiting (cond, seq, g, private); -+ result = err; -+ break; -+ } -+ } - - /* Confirm that we have been woken. We do that before acquiring the mutex - to allow for execution of pthread_cond_destroy while having acquired the --- -2.49.0 - diff --git a/meta/recipes-core/glibc/glibc/0026-PR25847-7.patch b/meta/recipes-core/glibc/glibc/0026-PR25847-7.patch deleted file mode 100644 index a9e9cc7c48..0000000000 --- a/meta/recipes-core/glibc/glibc/0026-PR25847-7.patch +++ /dev/null @@ -1,160 +0,0 @@ -From 2a601ac9041e2ca645acad2c174b1c545cfceafe Mon Sep 17 00:00:00 2001 -From: Malte Skarupke -Date: Tue, 17 Jun 2025 01:53:25 -0700 -Subject: [PATCH] nptl: rename __condvar_quiesce_and_switch_g1 - -This function no longer waits for threads to leave g1, so rename it to -__condvar_switch_g1 - -The following commits have been cherry-picked from Glibc master branch: -Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 - -Upstream-Status: Backport -[https://sourceware.org/git/?p=glibc.git;a=commit;h=4b79e27a5073c02f6bff9aa8f4791230a0ab1867] - -Signed-off-by: Sunil Dora ---- - nptl/pthread_cond_broadcast.c | 4 ++-- - nptl/pthread_cond_common.c | 26 ++++++++++++-------------- - nptl/pthread_cond_signal.c | 17 ++++++++--------- - nptl/pthread_cond_wait.c | 9 ++++----- - 4 files changed, 26 insertions(+), 30 deletions(-) - -diff --git a/nptl/pthread_cond_broadcast.c b/nptl/pthread_cond_broadcast.c -index 5ae141ac81..a07435589a 100644 ---- a/nptl/pthread_cond_broadcast.c -+++ b/nptl/pthread_cond_broadcast.c -@@ -60,7 +60,7 @@ ___pthread_cond_broadcast (pthread_cond_t *cond) - cond->__data.__g_size[g1] << 1); - cond->__data.__g_size[g1] = 0; - -- /* We need to wake G1 waiters before we quiesce G1 below. */ -+ /* We need to wake G1 waiters before we switch G1 below. */ - /* TODO Only set it if there are indeed futex waiters. We could - also try to move this out of the critical section in cases when - G2 is empty (and we don't need to quiesce). */ -@@ -69,7 +69,7 @@ ___pthread_cond_broadcast (pthread_cond_t *cond) - - /* G1 is complete. Step (2) is next unless there are no waiters in G2, in - which case we can stop. */ -- if (__condvar_quiesce_and_switch_g1 (cond, wseq, &g1, private)) -+ if (__condvar_switch_g1 (cond, wseq, &g1, private)) - { - /* Step (3): Send signals to all waiters in the old G2 / new G1. */ - atomic_fetch_add_relaxed (cond->__data.__g_signals + g1, -diff --git a/nptl/pthread_cond_common.c b/nptl/pthread_cond_common.c -index f976a533a1..3baac4dabc 100644 ---- a/nptl/pthread_cond_common.c -+++ b/nptl/pthread_cond_common.c -@@ -189,16 +189,15 @@ __condvar_get_private (int flags) - return FUTEX_SHARED; - } - --/* This closes G1 (whose index is in G1INDEX), waits for all futex waiters to -- leave G1, converts G1 into a fresh G2, and then switches group roles so that -- the former G2 becomes the new G1 ending at the current __wseq value when we -- eventually make the switch (WSEQ is just an observation of __wseq by the -- signaler). -+/* This closes G1 (whose index is in G1INDEX), converts G1 into a fresh G2, -+ and then switches group roles so that the former G2 becomes the new G1 -+ ending at the current __wseq value when we eventually make the switch -+ (WSEQ is just an observation of __wseq by the signaler). - If G2 is empty, it will not switch groups because then it would create an - empty G1 which would require switching groups again on the next signal. - Returns false iff groups were not switched because G2 was empty. */ - static bool __attribute__ ((unused)) --__condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq, -+__condvar_switch_g1 (pthread_cond_t *cond, uint64_t wseq, - unsigned int *g1index, int private) - { - unsigned int g1 = *g1index; -@@ -214,8 +213,7 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq, - + cond->__data.__g_size[g1 ^ 1]) == 0) - return false; - -- /* Now try to close and quiesce G1. We have to consider the following kinds -- of waiters: -+ /* We have to consider the following kinds of waiters: - * Waiters from less recent groups than G1 are not affected because - nothing will change for them apart from __g1_start getting larger. - * New waiters arriving concurrently with the group switching will all go -@@ -223,12 +221,12 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq, - are not affected. - * Waiters in G1 have already received a signal and been woken. */ - -- /* Update __g1_start, which finishes closing this group. The value we add -- will never be negative because old_orig_size can only be zero when we -- switch groups the first time after a condvar was initialized, in which -- case G1 will be at index 1 and we will add a value of 1. -- Relaxed MO is fine because the change comes with no additional -- constraints that others would have to observe. */ -+ /* Update __g1_start, which closes this group. The value we add will never -+ be negative because old_orig_size can only be zero when we switch groups -+ the first time after a condvar was initialized, in which case G1 will be -+ at index 1 and we will add a value of 1. Relaxed MO is fine because the -+ change comes with no additional constraints that others would have to -+ observe. */ - __condvar_add_g1_start_relaxed (cond, - (old_orig_size << 1) + (g1 == 1 ? 1 : - 1)); - -diff --git a/nptl/pthread_cond_signal.c b/nptl/pthread_cond_signal.c -index 14800ba00b..a9bc10dcca 100644 ---- a/nptl/pthread_cond_signal.c -+++ b/nptl/pthread_cond_signal.c -@@ -69,18 +69,17 @@ ___pthread_cond_signal (pthread_cond_t *cond) - bool do_futex_wake = false; - - /* If G1 is still receiving signals, we put the signal there. If not, we -- check if G2 has waiters, and if so, quiesce and switch G1 to the former -- G2; if this results in a new G1 with waiters (G2 might have cancellations -- already, see __condvar_quiesce_and_switch_g1), we put the signal in the -- new G1. */ -+ check if G2 has waiters, and if so, switch G1 to the former G2; if this -+ results in a new G1 with waiters (G2 might have cancellations already, -+ see __condvar_switch_g1), we put the signal in the new G1. */ - if ((cond->__data.__g_size[g1] != 0) -- || __condvar_quiesce_and_switch_g1 (cond, wseq, &g1, private)) -+ || __condvar_switch_g1 (cond, wseq, &g1, private)) - { - /* Add a signal. Relaxed MO is fine because signaling does not need to -- establish a happens-before relation (see above). We do not mask the -- release-MO store when initializing a group in -- __condvar_quiesce_and_switch_g1 because we use an atomic -- read-modify-write and thus extend that store's release sequence. */ -+ establish a happens-before relation (see above). We do not mask the -+ release-MO store when initializing a group in __condvar_switch_g1 -+ because we use an atomic read-modify-write and thus extend that -+ store's release sequence. */ - atomic_fetch_add_relaxed (cond->__data.__g_signals + g1, 2); - cond->__data.__g_size[g1]--; - /* TODO Only set it if there are indeed futex waiters. */ -diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c -index 104ebd48ca..bb46f3605d 100644 ---- a/nptl/pthread_cond_wait.c -+++ b/nptl/pthread_cond_wait.c -@@ -382,8 +382,7 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - because we do not need to establish any happens-before relation with - signalers (see __pthread_cond_signal); modification order alone - establishes a total order of waiters/signals. We do need acquire MO -- to synchronize with group reinitialization in -- __condvar_quiesce_and_switch_g1. */ -+ to synchronize with group reinitialization in __condvar_switch_g1. */ - uint64_t wseq = __condvar_fetch_add_wseq_acquire (cond, 2); - /* Find our group's index. We always go into what was G2 when we acquired - our position. */ -@@ -414,9 +413,9 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - { - /* Now wait until a signal is available in our group or it is closed. - Acquire MO so that if we observe (signals == lowseq) after group -- switching in __condvar_quiesce_and_switch_g1, we synchronize with that -- store and will see the prior update of __g1_start done while switching -- groups too. */ -+ switching in __condvar_switch_g1, we synchronize with that store and -+ will see the prior update of __g1_start done while switching groups -+ too. */ - unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g); - uint64_t g1_start = __condvar_load_g1_start_relaxed (cond); - unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; --- -2.49.0 - diff --git a/meta/recipes-core/glibc/glibc/0026-PR25847-8.patch b/meta/recipes-core/glibc/glibc/0026-PR25847-8.patch deleted file mode 100644 index 8ea0c784ef..0000000000 --- a/meta/recipes-core/glibc/glibc/0026-PR25847-8.patch +++ /dev/null @@ -1,192 +0,0 @@ -From fc074de88796eb2036fbe9bade638e00adfd5cb2 Mon Sep 17 00:00:00 2001 -From: Malte Skarupke -Date: Tue, 17 Jun 2025 02:08:36 -0700 -Subject: [PATCH] nptl: Use all of g1_start and g_signals - -The LSB of g_signals was unused. The LSB of g1_start was used to indicate -which group is G2. This was used to always go to sleep in pthread_cond_wait -if a waiter is in G2. A comment earlier in the file says that this is not -correct to do: - - "Waiters cannot determine whether they are currently in G2 or G1 -- but they - do not have to because all they are interested in is whether there are - available signals" - -I either would have had to update the comment, or get rid of the check. I -chose to get rid of the check. In fact I don't quite know why it was there. -There will never be available signals for group G2, so we didn't need the -special case. Even if there were, this would just be a spurious wake. This -might have caught some cases where the count has wrapped around, but it -wouldn't reliably do that, (and even if it did, why would you want to force a -sleep in that case?) and we don't support that many concurrent waiters -anyway. Getting rid of it allows us to use one more bit, making us more -robust to wraparound. - -The following commits have been cherry-picked from Glibc master branch: -Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 - -Upstream-Status: Backport -[https://sourceware.org/git/?p=glibc.git;a=commit;h=91bb902f58264a2fd50fbce8f39a9a290dd23706] - -Signed-off-by: Sunil Dora ---- - nptl/pthread_cond_broadcast.c | 4 ++-- - nptl/pthread_cond_common.c | 26 ++++++++++---------------- - nptl/pthread_cond_signal.c | 2 +- - nptl/pthread_cond_wait.c | 14 +++++--------- - 4 files changed, 18 insertions(+), 28 deletions(-) - -diff --git a/nptl/pthread_cond_broadcast.c b/nptl/pthread_cond_broadcast.c -index a07435589a..ef0943cdc5 100644 ---- a/nptl/pthread_cond_broadcast.c -+++ b/nptl/pthread_cond_broadcast.c -@@ -57,7 +57,7 @@ ___pthread_cond_broadcast (pthread_cond_t *cond) - { - /* Add as many signals as the remaining size of the group. */ - atomic_fetch_add_relaxed (cond->__data.__g_signals + g1, -- cond->__data.__g_size[g1] << 1); -+ cond->__data.__g_size[g1]); - cond->__data.__g_size[g1] = 0; - - /* We need to wake G1 waiters before we switch G1 below. */ -@@ -73,7 +73,7 @@ ___pthread_cond_broadcast (pthread_cond_t *cond) - { - /* Step (3): Send signals to all waiters in the old G2 / new G1. */ - atomic_fetch_add_relaxed (cond->__data.__g_signals + g1, -- cond->__data.__g_size[g1] << 1); -+ cond->__data.__g_size[g1]); - cond->__data.__g_size[g1] = 0; - /* TODO Only set it if there are indeed futex waiters. */ - do_futex_wake = true; -diff --git a/nptl/pthread_cond_common.c b/nptl/pthread_cond_common.c -index 3baac4dabc..e48f914321 100644 ---- a/nptl/pthread_cond_common.c -+++ b/nptl/pthread_cond_common.c -@@ -208,9 +208,9 @@ __condvar_switch_g1 (pthread_cond_t *cond, uint64_t wseq, - behavior. - Note that this works correctly for a zero-initialized condvar too. */ - unsigned int old_orig_size = __condvar_get_orig_size (cond); -- uint64_t old_g1_start = __condvar_load_g1_start_relaxed (cond) >> 1; -- if (((unsigned) (wseq - old_g1_start - old_orig_size) -- + cond->__data.__g_size[g1 ^ 1]) == 0) -+ uint64_t old_g1_start = __condvar_load_g1_start_relaxed (cond); -+ uint64_t new_g1_start = old_g1_start + old_orig_size; -+ if (((unsigned) (wseq - new_g1_start) + cond->__data.__g_size[g1 ^ 1]) == 0) - return false; - - /* We have to consider the following kinds of waiters: -@@ -221,16 +221,10 @@ __condvar_switch_g1 (pthread_cond_t *cond, uint64_t wseq, - are not affected. - * Waiters in G1 have already received a signal and been woken. */ - -- /* Update __g1_start, which closes this group. The value we add will never -- be negative because old_orig_size can only be zero when we switch groups -- the first time after a condvar was initialized, in which case G1 will be -- at index 1 and we will add a value of 1. Relaxed MO is fine because the -- change comes with no additional constraints that others would have to -- observe. */ -- __condvar_add_g1_start_relaxed (cond, -- (old_orig_size << 1) + (g1 == 1 ? 1 : - 1)); -- -- unsigned int lowseq = ((old_g1_start + old_orig_size) << 1) & ~1U; -+ /* Update __g1_start, which closes this group. Relaxed MO is fine because -+ the change comes with no additional constraints that others would have -+ to observe. */ -+ __condvar_add_g1_start_relaxed (cond, old_orig_size); - - /* At this point, the old G1 is now a valid new G2 (but not in use yet). - No old waiter can neither grab a signal nor acquire a reference without -@@ -242,13 +236,13 @@ __condvar_switch_g1 (pthread_cond_t *cond, uint64_t wseq, - g1 ^= 1; - *g1index ^= 1; - -- /* Now advance the new G1 g_signals to the new lowseq, giving it -+ /* Now advance the new G1 g_signals to the new g1_start, giving it - an effective signal count of 0 to start. */ -- atomic_store_release (cond->__data.__g_signals + g1, lowseq); -+ atomic_store_release (cond->__data.__g_signals + g1, (unsigned)new_g1_start); - - /* These values are just observed by signalers, and thus protected by the - lock. */ -- unsigned int orig_size = wseq - (old_g1_start + old_orig_size); -+ unsigned int orig_size = wseq - new_g1_start; - __condvar_set_orig_size (cond, orig_size); - /* Use and addition to not loose track of cancellations in what was - previously G2. */ -diff --git a/nptl/pthread_cond_signal.c b/nptl/pthread_cond_signal.c -index a9bc10dcca..07427369aa 100644 ---- a/nptl/pthread_cond_signal.c -+++ b/nptl/pthread_cond_signal.c -@@ -80,7 +80,7 @@ ___pthread_cond_signal (pthread_cond_t *cond) - release-MO store when initializing a group in __condvar_switch_g1 - because we use an atomic read-modify-write and thus extend that - store's release sequence. */ -- atomic_fetch_add_relaxed (cond->__data.__g_signals + g1, 2); -+ atomic_fetch_add_relaxed (cond->__data.__g_signals + g1, 1); - cond->__data.__g_size[g1]--; - /* TODO Only set it if there are indeed futex waiters. */ - do_futex_wake = true; -diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c -index bb46f3605d..430cbe8a35 100644 ---- a/nptl/pthread_cond_wait.c -+++ b/nptl/pthread_cond_wait.c -@@ -84,7 +84,7 @@ __condvar_cancel_waiting (pthread_cond_t *cond, uint64_t seq, unsigned int g, - not hold a reference on the group. */ - __condvar_acquire_lock (cond, private); - -- uint64_t g1_start = __condvar_load_g1_start_relaxed (cond) >> 1; -+ uint64_t g1_start = __condvar_load_g1_start_relaxed (cond); - if (g1_start > seq) - { - /* Our group is closed, so someone provided enough signals for it. -@@ -278,7 +278,6 @@ __condvar_cleanup_waiting (void *arg) - * Waiters fetch-add while having acquire the mutex associated with the - condvar. Signalers load it and fetch-xor it concurrently. - __g1_start: Starting position of G1 (inclusive) -- * LSB is index of current G2. - * Modified by signalers while having acquired the condvar-internal lock - and observed concurrently by waiters. - __g1_orig_size: Initial size of G1 -@@ -299,11 +298,9 @@ __condvar_cleanup_waiting (void *arg) - * Reference count used by waiters concurrently with signalers that have - acquired the condvar-internal lock. - __g_signals: The number of signals that can still be consumed, relative to -- the current g1_start. (i.e. bits 31 to 1 of __g_signals are bits -- 31 to 1 of g1_start with the signal count added) -+ the current g1_start. (i.e. g1_start with the signal count added) - * Used as a futex word by waiters. Used concurrently by waiters and - signalers. -- * LSB is currently reserved and 0. - __g_size: Waiters remaining in this group (i.e., which have not been - signaled yet. - * Accessed by signalers and waiters that cancel waiting (both do so only -@@ -418,9 +415,8 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - too. */ - unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g); - uint64_t g1_start = __condvar_load_g1_start_relaxed (cond); -- unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; - -- if (seq < (g1_start >> 1)) -+ if (seq < g1_start) - { - /* If the group is closed already, - then this waiter originally had enough extra signals to -@@ -433,13 +429,13 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, - by now, perhaps in the process of switching back to an older - G2, but in either case we're allowed to consume the available - signal and should not block anymore. */ -- if ((int)(signals - lowseq) >= 2) -+ if ((int)(signals - (unsigned int)g1_start) > 0) - { - /* Try to grab a signal. See above for MO. (if we do another loop - iteration we need to see the correct value of g1_start) */ - if (atomic_compare_exchange_weak_acquire ( - cond->__data.__g_signals + g, -- &signals, signals - 2)) -+ &signals, signals - 1)) - break; - else - continue; --- -2.49.0 - diff --git a/meta/recipes-core/glibc/glibc_2.35.bb b/meta/recipes-core/glibc/glibc_2.35.bb index 265dcb9129..ca7f630699 100644 --- a/meta/recipes-core/glibc/glibc_2.35.bb +++ b/meta/recipes-core/glibc/glibc_2.35.bb @@ -62,14 +62,6 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ file://0022-sysdeps-gnu-configure.ac-Set-libc_cv_rootsbindir-onl.patch \ file://0023-timezone-Make-shell-interpreter-overridable-in-tzsel.patch \ file://0024-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \ - file://0026-PR25847-1.patch \ - file://0026-PR25847-2.patch \ - file://0026-PR25847-3.patch \ - file://0026-PR25847-4.patch \ - file://0026-PR25847-5.patch \ - file://0026-PR25847-6.patch \ - file://0026-PR25847-7.patch \ - file://0026-PR25847-8.patch \ \ file://0001-Revert-Linux-Implement-a-useful-version-of-_startup_.patch \ file://0002-get_nscd_addresses-Fix-subscript-typos-BZ-29605.patch \ From patchwork Tue Oct 14 14:43:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kumar Dora X-Patchwork-Id: 72266 X-Patchwork-Delegate: steve@sakoman.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA4A4CCD184 for ; Tue, 14 Oct 2025 14:49:30 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.web10.18583.1760453369474061831 for ; Tue, 14 Oct 2025 07:49:29 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=T4QxI0eW; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=2382047737=sunilkumar.dora@windriver.com) Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 59E5i9DJ2987171 for ; Tue, 14 Oct 2025 07:49:29 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=6aa/IKl/rAK3BaBqlcnmh0eZDt+ZJh9gG593QiGmWOI=; b= T4QxI0eWBUCTI2x480h2n/WPC33T19ZXsQ1j9Uk/LVhoQZtRarVAlNPOxTGcwSu9 bC5/Z9dcrpOzHZvULQV0DDXfydVsuSogG3wWN0ENK4J19QT1rn+pRIjijyG6vz63 a0nJkEcxgxJ4K/vEz58dcBEo5C1WhKFc8SsliQa82xQmeXb2z5ahpkOjryndCUjA bdVzRvumVXzwlH5No7wNOO/uMxdizhCWoDB7SRinRq6qjYv3AjrqoE8EpByG7VfR It9jKTdGcWlm6RRUQFj/g9fKvs/Uh59YA1KdM/ZcOfn7DOYYWt4apDZMXdZ5zlmE s2FNrDFB53AYD0TXhIuTBg== Received: from sa9pr02cu001.outbound.protection.outlook.com (mail-southcentralusazon11013058.outbound.protection.outlook.com [40.93.196.58]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 49qjh1k47x-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Tue, 14 Oct 2025 07:49:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=h33T2BuzmAVaOaZJeIdmyGl1/nfxdrNZCs1P0fC8nI8EdHMsLN9c4+rqJIILhXhZdzlLP3HH5JamlJqSE2PHHk5oDMyEwV3/FXx/H2r6/+OgmSSP2U5KGLAvhj65h3BDA+ToVGGBfacCXOBQcORcM1QKs0iazTCseUxR9VsYf2S+7L6C0jzURS+YXm8PDnta+mlw7wYbZzk6YHCSjKa/UtrjxuTH6ED5S9qhkzm8SJlfqip6dM4MvS0QBzpsnIW39+kS2wj3M4gEs/mbRiuKo7PsYZAiTFrwQ7JfWXKlftW6h7fQEVoFuJX4JFRl9N77Y5IyhzlWih8I/03ibepMvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6aa/IKl/rAK3BaBqlcnmh0eZDt+ZJh9gG593QiGmWOI=; b=W+F6OseP8mSZsVwc3oiabNvgKQDGZBZdBy273OX6cVwO66krtU1xv19MIxbKx7xgxtGku+Hn7oIaC1mXrmMda0hAUOK1Z0EsU34hrOoaHIZMMOfq1bDQcTwjP0PjjgXtsMWFRfmATiqiOv6tuWuIVxs4IQLUY8rMC7cltKkrG/KBtgtFXsr5jRzo7yc9UCHxYxs88W8fLjIl8lm0rFuUEWv3+KzKVQBsi01fQsQJdzvudWZJQssTqk3Pc9moz+e6c3eXjWCO8bGWERXRTv1MIzUt4VYwJdGWFapUZp7s0RVV1JlNug4i4N3YkzAV51Rgt++UOiGXfyS1HL13tAZfTg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from DS0PR11MB7901.namprd11.prod.outlook.com (2603:10b6:8:f4::20) by DM4PR11MB6381.namprd11.prod.outlook.com (2603:10b6:8:bd::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9228.10; Tue, 14 Oct 2025 14:44:25 +0000 Received: from DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::9fa:eb3f:cf26:264d]) by DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::9fa:eb3f:cf26:264d%3]) with mapi id 15.20.9203.009; Tue, 14 Oct 2025 14:44:25 +0000 From: sunilkumar.dora@windriver.com To: openembedded-core@lists.openembedded.org Cc: Sundeep.Kokkonda@windriver.com, sunilkumar.dora@windriver.com Subject: [kirkstone][PATCH 02/11] glibc: pthreads NPTL lost wakeup fix 2 Date: Tue, 14 Oct 2025 07:43:38 -0700 Message-ID: <20251014144347.536537-3-sunilkumar.dora@windriver.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251014144347.536537-1-sunilkumar.dora@windriver.com> References: <20251014144347.536537-1-sunilkumar.dora@windriver.com> X-ClientProxiedBy: SJ0PR03CA0279.namprd03.prod.outlook.com (2603:10b6:a03:39e::14) To CH3PR11MB7896.namprd11.prod.outlook.com (2603:10b6:610:131::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7901:EE_|DM4PR11MB6381:EE_ X-MS-Office365-Filtering-Correlation-Id: e9cba65b-2a2b-47e0-3809-08de0b302b76 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|52116014|38350700014|13003099007; X-Microsoft-Antispam-Message-Info: sWQ5Y4dlSsTjZ7USD/ajpNQd0SaOp25+dhIJcNxMcYNdCWNNlzLOyMsunP+jQaHvekiiUWvT2Qw+BGh+mvQGWHi2JbqdbslTQxBRj+fIrZh5rQOQOps1HT0nbkbje/rBWIH4kF5Z+2buGsRm7fPVY6EwJiquwYcgSEGruPjlo4IQyV5L2kq1oko4alBAOKC7QB2RVAhOFijMRj50FAT8ey3mKTNL+hbFyH3IrM1w2M78zk8ygCXIbkErCwdM+hR/3e+GWStaVzQUpzP2F7pLLUHhXLlWZz+7P8lAo543Hfw+1Ekuj17iw0qrmj+HJKE0yn1fH+LU/SkdoeWx/bJcxr7j+WyFdnFjY1x/LzqR7J93vw9TbMBBf5GBINBY0oCinZZfSLxCqdD2+tIoR+nMBPmgcGLzBby9hh8JfJhiZpx8rGp3Ri94X5zAg55nOXYkvOfE8Xx/amymE9d1dHArrPNRUoM7n9bcZaKJ9Cv7CJFtDYDA3kMTeeTXoVm1zV4LmhlVSLQ+hWR7KiZhK9JPuo48U1VY7+DWXjJ98uXuTW/ZFn0Q5B7D/Eliwax/ErBGni0mB2FvfcYQLzg8dg5yO1G28WNnwIlB5e0GNjDHV9VgfEyV2dPDOt2PthFdBKi1kTOxYL+/Tc6T/AxxdUZdW7f8YLnAKZuFtqKkHlwSMJl7nUko7H71pJtX2ZrMQi9zw4gHp7UdMc4nRLKbW/sagJppMxPgNytGbXLV4XntbKRXlSzzJmt7gCid2d4Izhsx7xOvF4A5yxVh2Fe9idhRB3Wj4m7vREnIr0y3O+Qt9h4B3AjqLAXWr8kAbdwu7GmZT/TtDt94KC57xkKpsgpG/YNmwAmMbc7wE0yxUFVrXSz09Xa5J+NGN/gA8emdCdmu0rSQK2Sv/vmjeXj3kqgwPLFNLbPEgN5TNHn82PrwDZnsFDw9y8jWO+OOmk9S0UIOzZ870k62IBjwLsNgbX4kaYaf9fy6thZFwqoJC/sUAlXX9OigYyIBm+FBz6pkXHKIZ0GccSHt4ea746lhju/inpqrc9mtsNAelOtW5PbTSbsdh1arOQkVAJo0p7rfinLinJT57Ucg60FVn3hA3LYC2REJINc3qmKTSNYiR6VD5/yHYhBsS9ehbomIHPkt+24uqYxgrVjQHL19mby6aTEHVHdlg9oqAQ5QBx9A/pa4TzEZispD1hB/Wwi/cIf1BqPgVSLq8WyU6ALaeV9unKg2VN76JgNpdP56qpijKea7swpN8Qs1NucDS1lLQPjOwpz6KiFfvNxz5vFIUm+XgpJ38Szh0BwBluH9CkJq8/dW4D+p+tMA49Jaj3KQfKg4L8Ff+pz4dzZrVVUhXjTdKrGqKdrv5eP5fEeL++LnV+BQorPhOhaa4azpDuoQZYzQpMDdRyKFpmX1LnqGyZXRHIEJyPbPWUyOKUYW7SVAcYjaQf3E+MR3uGVGMOHXM/1tbcR0w4FSZE1C74W0xaWSWC141w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB7901.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016)(52116014)(38350700014)(13003099007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: T6H9k/gdKmcdEuhXrGf6xfyRHYcAsO1jLFpti6TAVvYfgIFN2wbdtsZTgOQJsF0i887m+cf9ZEw8CepyN6yKZNXks9Ayqz8UdVMiwAhCrXZKOnMSw90jhlzchwAxo2OprmCQ4Z6/DiFMFmXPExqknaAcHX2STDI8sAUscHyvmDGWKo7uBrtmhrt6M7Vjr4mdU8pRIhmTIbUZ4rRzyiniULCo7RuanootC4BSw0jARtdLPn4FCYNh8imuDTR3VPoVDItiPyPnkenH97HU9NIxlGIcDuZq2WJ7iz7dvxVYz+sCQwtX617GKSQoOClAwfLg38mBTccIgnAKangs645uHjNpKDHn85Jj29EqCLb9NU5Dcz1m1QkBt7BrF8MtO1PzzaWhVZOEU+YOUv6dWTVMriBGU1Jw8ZZ2g0p+JTZlmpwzLvmnfAY7fTcC3Q4E1HrYpR/U1k7y10wUEW8h6ZGif/SGxfRVwuurwo3Rnaa+zgB7imCMQiqOU7Sy1VpvDWYF/tIqZ1sTx/tUp87z261omi6Nj0FA2ODOCgm3y5m9LvOlNobiWIgp+ns0JZGwSzTfA4v1QA7aNXYbdKmQMQpiKme23TsicStFlZW9CUYTlkcOBgDVdU9fvKhM5dcTvqkKiADH7T6GaWmflMtUVy+X3vRhrnwLj8bVQRGCzfq/HUKimDy6hSQO6pDUqPx0uND2Cx3tpmMqLz37b8i3h43NaHbLYzLIV4QiHpdZAmekeFernwvBO48FuCNqoy4zO7ecrLxnZZ2qTttprQk4ZDXU+wEhkeAbiaZ7V3ugxhYz4I1tzM1lR3nEcA1iCJs+v+Uu+vFpK0UG2W9wUErk1Fyp7Gm2tVVIIHvuKOQFLZxaWIwfVuvnScde8n0HrygdzyiZxUYTKZzNHybi7HY/olZKzuI411cLh9SbXhg96u3yHv+8+2ryhNbKgxq93dpDd2FPyYo8Fy5KbA1hFSigtHBnzmNCdUKU+YPCvPL709SYn1pM68QAMwX4Z5Rl1vkTRX38Y8C2BLGiB2MsddN/l3yK4eTFc25bc89vt97IQIacuh6FY+Erif0vsYQlLsrTRAI45uNq7Gvl4Nc1LIJ7lwdCBYtkDVKZFk8ZrawHoDshcBPL73pkKqBLnIOju+2W7IW3/FOQwp7bjChYltNERxB3/ldtE1bC/ATzuh26nYXgmujdsKEEdKqUK9xBgSedaQMQ5fcFBR9Co9ZR0OyHds+DKoEcYVn3X4PZOdm7CRyx50usS8PiOUhb7DfKFPPaq3R65/DvP/6I1UyH+t5LBJ1potQ5czqlHSN3zcYfSM4BeFJveY3e464fD4hh2HArKZPj04nx4Joa4LZnu5WSQileUEyCJKPUtzwUQ2fDaNV5/wvlvs0O9EpNpXYlqCRt3Id3Aq65ObxNKlBOLdvnHr3pwhjyOstojUPynavNYrr1G9bgKRcSiUrF77nv5pxyom/+YvEHeqR7wSBvgk0HWyAwIEKV3ib1299c2n+x+BwmLwqw42F3m1thM1afjv9qmyon9yh/NLYGPXrrQ7Aj07S+QcI4R0DbCS/RGZqTMWj5TLzcYOSWYXJ0AToHnklxs1aeqH06DN34EJlp21JsudHGiA== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: e9cba65b-2a2b-47e0-3809-08de0b302b76 X-MS-Exchange-CrossTenant-AuthSource: CH3PR11MB7896.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2025 14:44:25.3941 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Qbg876cCyhPhpjKLZzQSjSdJcFVyeHQx3FIOtT8opEeVpZ3cxRJWWzYL2HF2KFjp+XDAdv8FNHQD/xxBVk9/IqdFVdkSzZhVkrJAUrDZfRE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB6381 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDE0MDExMiBTYWx0ZWRfX6MxQaaAxS6dy GmYI3DujkOPHkYdFqDMIbSdwbBeHk9wnrgJ48kjpgxnzcJ2GAUUgY0hQSdcKeCXsekGeDOUeQIt bYdPQoAXqhnshZ9hALUlaBpLXiFdmlYMmUxyKx6QFE7dkTCqIfxzmHGGCzxZVsivjuDvCvEYERU oL2HIYKjafTNRxhnrngT67J6jAME7SzKmkdqXnqqZQi/0ciQQZ4CFyhNXKjA0GDLZRK0Cf7oK/0 V1rjb4l7q7V71rfGSB3TxxK8nNtAQmpPCoVn3BU5EtNYkGLFHVsdfHZQqVppbELE3fYfcEb4y++ Gj9KGQ4+u2yP2BZ5TTopcMKBO/pU1Yuajo3clC8wqjWzqzPsBVImYGdo48KsiAEHFB8MoTqF80W Q7xDRCLZsNj8A93iigw2kWwSJjfPWQ== X-Proofpoint-GUID: AZ6tKjSLWPlr8HZ4q1jwfbagBk0U16un X-Proofpoint-ORIG-GUID: AZ6tKjSLWPlr8HZ4q1jwfbagBk0U16un X-Authority-Analysis: v=2.4 cv=aetsXBot c=1 sm=1 tr=0 ts=68ee62f9 cx=c_pps a=5YU8ENXygJz5UkgxsLF+dA==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=CCpqsmhAAAAA:8 a=t7CeM3EgAAAA:8 a=-y7sjS4E6xoPhqQzj00A:9 a=NrfbpRTlr6kA:10 a=ul9cdbp4aOFLsgKbc677:22 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-14_03,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 suspectscore=0 phishscore=0 malwarescore=0 clxscore=1015 impostorscore=0 bulkscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510020000 definitions=main-2510140112 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 14 Oct 2025 14:49:30 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224831 From: Sunil Dora The following commits have been cherry-picked from Glibc master branch: Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=1db84775f831a1494993ce9c118deaf9537cc50a [2] https://sourceware.org/pipermail/libc-stable/2025-July/002277.html Signed-off-by: Sunil Dora --- .../glibc/glibc/0026-PR25847-1.patch | 455 ++++++++++++++++++ meta/recipes-core/glibc/glibc_2.35.bb | 1 + 2 files changed, 456 insertions(+) create mode 100644 meta/recipes-core/glibc/glibc/0026-PR25847-1.patch diff --git a/meta/recipes-core/glibc/glibc/0026-PR25847-1.patch b/meta/recipes-core/glibc/glibc/0026-PR25847-1.patch new file mode 100644 index 0000000000..0f81f5b40b --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0026-PR25847-1.patch @@ -0,0 +1,455 @@ +From 0402999b82f697011de388f61bad68da26060bef Mon Sep 17 00:00:00 2001 +From: Frank Barrus +Date: Tue, 14 Oct 2025 03:55:17 -0700 +Subject: [PATCH] pthreads NPTL: lost wakeup fix 2 + +This fixes the lost wakeup (from a bug in signal stealing) with a change +in the usage of g_signals[] in the condition variable internal state. +It also completely eliminates the concept and handling of signal stealing, +as well as the need for signalers to block to wait for waiters to wake +up every time there is a G1/G2 switch. This greatly reduces the average +and maximum latency for pthread_cond_signal. + +The g_signals[] field now contains a signal count that is relative to +the current g1_start value. Since it is a 32-bit field, and the LSB is +still reserved (though not currently used anymore), it has a 31-bit value +that corresponds to the low 31 bits of the sequence number in g1_start. +(since g1_start also has an LSB flag, this means bits 31:1 in g_signals +correspond to bits 31:1 in g1_start, plus the current signal count) + +By making the signal count relative to g1_start, there is no longer +any ambiguity or A/B/A issue, and thus any checks before blocking, +including the futex call itself, are guaranteed not to block if the G1/G2 +switch occurs, even if the signal count remains the same. This allows +initially safely blocking in G2 until the switch to G1 occurs, and +then transitioning from G1 to a new G1 or G2, and always being able to +distinguish the state change. This removes the race condition and A/B/A +problems that otherwise ocurred if a late (pre-empted) waiter were to +resume just as the futex call attempted to block on g_signal since +otherwise there was no last opportunity to re-check things like whether +the current G1 group was already closed. + +By fixing these issues, the signal stealing code can be eliminated, +since there is no concept of signal stealing anymore. The code to block +for all waiters to exit g_refs can also be removed, since any waiters +that are still in the g_refs region can be guaranteed to safely wake +up and exit. If there are still any left at this time, they are all +sent one final futex wakeup to ensure that they are not blocked any +longer, but there is no need for the signaller to block and wait for +them to wake up and exit the g_refs region. + +The signal count is then effectively "zeroed" but since it is now +relative to g1_start, this is done by advancing it to a new value that +can be observed by any pending blocking waiters. Any late waiters can +always tell the difference, and can thus just cleanly exit if they are +in a stale G1 or G2. They can never steal a signal from the current +G1 if they are not in the current G1, since the signal value that has +to match in the cmpxchg has the low 31 bits of the g1_start value +contained in it, and that's first checked, and then it won't match if +there's a G1/G2 change. + +Note: the 31-bit sequence number used in g_signals is designed to +handle wrap-around when checking the signal count, but if the entire +31-bit wraparound (2 billion signals) occurs while there is still a +late waiter that has not yet resumed, and it happens to then match +the current g1_start low bits, and the pre-emption occurs after the +normal "closed group" checks (which are 64-bit) but then hits the +futex syscall and signal consuming code, then an A/B/A issue could +still result and cause an incorrect assumption about whether it +should block. This particular scenario seems unlikely in practice. +Note that once awake from the futex, the waiter would notice the +closed group before consuming the signal (since that's still a 64-bit +check that would not be aliased in the wrap-around in g_signals), +so the biggest impact would be blocking on the futex until the next +full wakeup from a G1/G2 switch. + +The following commits have been cherry-picked from Glibc master branch: +Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 +Commit : 1db84775f831a1494993ce9c118deaf9537cc50a + +Upstream-Status: Submitted +[https://sourceware.org/pipermail/libc-stable/2025-July/002277.html] + +Signed-off-by: Sunil Dora +--- + nptl/pthread_cond_common.c | 105 +++++++++------------------ + nptl/pthread_cond_wait.c | 144 ++++++++++++------------------------- + 2 files changed, 81 insertions(+), 168 deletions(-) + +diff --git a/nptl/pthread_cond_common.c b/nptl/pthread_cond_common.c +index fb035f72..a55eee3e 100644 +--- a/nptl/pthread_cond_common.c ++++ b/nptl/pthread_cond_common.c +@@ -201,7 +201,6 @@ static bool __attribute__ ((unused)) + __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq, + unsigned int *g1index, int private) + { +- const unsigned int maxspin = 0; + unsigned int g1 = *g1index; + + /* If there is no waiter in G2, we don't do anything. The expression may +@@ -222,84 +221,46 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq, + * New waiters arriving concurrently with the group switching will all go + into G2 until we atomically make the switch. Waiters existing in G2 + are not affected. +- * Waiters in G1 will be closed out immediately by setting a flag in +- __g_signals, which will prevent waiters from blocking using a futex on +- __g_signals and also notifies them that the group is closed. As a +- result, they will eventually remove their group reference, allowing us +- to close switch group roles. */ +- +- /* First, set the closed flag on __g_signals. This tells waiters that are +- about to wait that they shouldn't do that anymore. This basically +- serves as an advance notificaton of the upcoming change to __g1_start; +- waiters interpret it as if __g1_start was larger than their waiter +- sequence position. This allows us to change __g1_start after waiting +- for all existing waiters with group references to leave, which in turn +- makes recovery after stealing a signal simpler because it then can be +- skipped if __g1_start indicates that the group is closed (otherwise, +- we would have to recover always because waiters don't know how big their +- groups are). Relaxed MO is fine. */ +- atomic_fetch_or_relaxed (cond->__data.__g_signals + g1, 1); +- +- /* Wait until there are no group references anymore. The fetch-or operation +- injects us into the modification order of __g_refs; release MO ensures +- that waiters incrementing __g_refs after our fetch-or see the previous +- changes to __g_signals and to __g1_start that had to happen before we can +- switch this G1 and alias with an older group (we have two groups, so +- aliasing requires switching group roles twice). Note that nobody else +- can have set the wake-request flag, so we do not have to act upon it. +- +- Also note that it is harmless if older waiters or waiters from this G1 +- get a group reference after we have quiesced the group because it will +- remain closed for them either because of the closed flag in __g_signals +- or the later update to __g1_start. New waiters will never arrive here +- but instead continue to go into the still current G2. */ +- unsigned r = atomic_fetch_or_release (cond->__data.__g_refs + g1, 0); +- while ((r >> 1) > 0) +- { +- for (unsigned int spin = maxspin; ((r >> 1) > 0) && (spin > 0); spin--) +- { +- /* TODO Back off. */ +- r = atomic_load_relaxed (cond->__data.__g_refs + g1); +- } +- if ((r >> 1) > 0) +- { +- /* There is still a waiter after spinning. Set the wake-request +- flag and block. Relaxed MO is fine because this is just about +- this futex word. +- +- Update r to include the set wake-request flag so that the upcoming +- futex_wait only blocks if the flag is still set (otherwise, we'd +- violate the basic client-side futex protocol). */ +- r = atomic_fetch_or_relaxed (cond->__data.__g_refs + g1, 1) | 1; +- +- if ((r >> 1) > 0) +- futex_wait_simple (cond->__data.__g_refs + g1, r, private); +- /* Reload here so we eventually see the most recent value even if we +- do not spin. */ +- r = atomic_load_relaxed (cond->__data.__g_refs + g1); +- } +- } +- /* Acquire MO so that we synchronize with the release operation that waiters +- use to decrement __g_refs and thus happen after the waiters we waited +- for. */ +- atomic_thread_fence_acquire (); ++ * Waiters in G1 will be closed out immediately by the advancing of ++ __g_signals to the next "lowseq" (low 31 bits of the new g1_start), ++ which will prevent waiters from blocking using a futex on ++ __g_signals since it provides enough signals for all possible ++ remaining waiters. As a result, they can each consume a signal ++ and they will eventually remove their group reference. */ + + /* Update __g1_start, which finishes closing this group. The value we add + will never be negative because old_orig_size can only be zero when we + switch groups the first time after a condvar was initialized, in which +- case G1 will be at index 1 and we will add a value of 1. See above for +- why this takes place after waiting for quiescence of the group. ++ case G1 will be at index 1 and we will add a value of 1. + Relaxed MO is fine because the change comes with no additional + constraints that others would have to observe. */ + __condvar_add_g1_start_relaxed (cond, + (old_orig_size << 1) + (g1 == 1 ? 1 : - 1)); + +- /* Now reopen the group, thus enabling waiters to again block using the +- futex controlled by __g_signals. Release MO so that observers that see +- no signals (and thus can block) also see the write __g1_start and thus +- that this is now a new group (see __pthread_cond_wait_common for the +- matching acquire MO loads). */ +- atomic_store_release (cond->__data.__g_signals + g1, 0); ++ unsigned int lowseq = ((old_g1_start + old_orig_size) << 1) & ~1U; ++ ++ /* If any waiters still hold group references (and thus could be blocked), ++ then wake them all up now and prevent any running ones from blocking. ++ This is effectively a catch-all for any possible current or future ++ bugs that can allow the group size to reach 0 before all G1 waiters ++ have been awakened or at least given signals to consume, or any ++ other case that can leave blocked (or about to block) older waiters.. */ ++ if ((atomic_fetch_or_release (cond->__data.__g_refs + g1, 0) >> 1) > 0) ++ { ++ /* First advance signals to the end of the group (i.e. enough signals ++ for the entire G1 group) to ensure that waiters which have not ++ yet blocked in the futex will not block. ++ Note that in the vast majority of cases, this should never ++ actually be necessary, since __g_signals will have enough ++ signals for the remaining g_refs waiters. As an optimization, ++ we could check this first before proceeding, although that ++ could still leave the potential for futex lost wakeup bugs ++ if the signal count was non-zero but the futex wakeup ++ was somehow lost. */ ++ atomic_store_release (cond->__data.__g_signals + g1, lowseq); ++ ++ futex_wake (cond->__data.__g_signals + g1, INT_MAX, private); ++ } + + /* At this point, the old G1 is now a valid new G2 (but not in use yet). + No old waiter can neither grab a signal nor acquire a reference without +@@ -311,6 +272,10 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq, + g1 ^= 1; + *g1index ^= 1; + ++ /* Now advance the new G1 g_signals to the new lowseq, giving it ++ an effective signal count of 0 to start. */ ++ atomic_store_release (cond->__data.__g_signals + g1, lowseq); ++ + /* These values are just observed by signalers, and thus protected by the + lock. */ + unsigned int orig_size = wseq - (old_g1_start + old_orig_size); +diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c +index 20c348a5..1cb3dbf7 100644 +--- a/nptl/pthread_cond_wait.c ++++ b/nptl/pthread_cond_wait.c +@@ -238,9 +238,7 @@ __condvar_cleanup_waiting (void *arg) + signaled), and a reference count. + + The group reference count is used to maintain the number of waiters that +- are using the group's futex. Before a group can change its role, the +- reference count must show that no waiters are using the futex anymore; this +- prevents ABA issues on the futex word. ++ are using the group's futex. + + To represent which intervals in the waiter sequence the groups cover (and + thus also which group slot contains G1 or G2), we use a 64b counter to +@@ -300,11 +298,12 @@ __condvar_cleanup_waiting (void *arg) + last reference. + * Reference count used by waiters concurrently with signalers that have + acquired the condvar-internal lock. +- __g_signals: The number of signals that can still be consumed. ++ __g_signals: The number of signals that can still be consumed, relative to ++ the current g1_start. (i.e. bits 31 to 1 of __g_signals are bits ++ 31 to 1 of g1_start with the signal count added) + * Used as a futex word by waiters. Used concurrently by waiters and + signalers. +- * LSB is true iff this group has been completely signaled (i.e., it is +- closed). ++ * LSB is currently reserved and 0. + __g_size: Waiters remaining in this group (i.e., which have not been + signaled yet. + * Accessed by signalers and waiters that cancel waiting (both do so only +@@ -328,18 +327,6 @@ __condvar_cleanup_waiting (void *arg) + sufficient because if a waiter can see a sufficiently large value, it could + have also consume a signal in the waiters group. + +- Waiters try to grab a signal from __g_signals without holding a reference +- count, which can lead to stealing a signal from a more recent group after +- their own group was already closed. They cannot always detect whether they +- in fact did because they do not know when they stole, but they can +- conservatively add a signal back to the group they stole from; if they +- did so unnecessarily, all that happens is a spurious wake-up. To make this +- even less likely, __g1_start contains the index of the current g2 too, +- which allows waiters to check if there aliasing on the group slots; if +- there wasn't, they didn't steal from the current G1, which means that the +- G1 they stole from must have been already closed and they do not need to +- fix anything. +- + It is essential that the last field in pthread_cond_t is __g_signals[1]: + The previous condvar used a pointer-sized field in pthread_cond_t, so a + PTHREAD_COND_INITIALIZER from that condvar implementation might only +@@ -435,6 +422,9 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + { + while (1) + { ++ uint64_t g1_start = __condvar_load_g1_start_relaxed (cond); ++ unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; ++ + /* Spin-wait first. + Note that spinning first without checking whether a timeout + passed might lead to what looks like a spurious wake-up even +@@ -446,35 +436,45 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + having to compare against the current time seems to be the right + choice from a performance perspective for most use cases. */ + unsigned int spin = maxspin; +- while (signals == 0 && spin > 0) ++ while (spin > 0 && ((int)(signals - lowseq) < 2)) + { + /* Check that we are not spinning on a group that's already + closed. */ +- if (seq < (__condvar_load_g1_start_relaxed (cond) >> 1)) +- goto done; ++ if (seq < (g1_start >> 1)) ++ break; + + /* TODO Back off. */ + + /* Reload signals. See above for MO. */ + signals = atomic_load_acquire (cond->__data.__g_signals + g); ++ g1_start = __condvar_load_g1_start_relaxed (cond); ++ lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; + spin--; + } + +- /* If our group will be closed as indicated by the flag on signals, +- don't bother grabbing a signal. */ +- if (signals & 1) +- goto done; +- +- /* If there is an available signal, don't block. */ +- if (signals != 0) ++ if (seq < (g1_start >> 1)) ++ { ++ /* If the group is closed already, ++ then this waiter originally had enough extra signals to ++ consume, up until the time its group was closed. */ ++ goto done; ++ } ++ ++ /* If there is an available signal, don't block. ++ If __g1_start has advanced at all, then we must be in G1 ++ by now, perhaps in the process of switching back to an older ++ G2, but in either case we're allowed to consume the available ++ signal and should not block anymore. */ ++ if ((int)(signals - lowseq) >= 2) + break; + + /* No signals available after spinning, so prepare to block. + We first acquire a group reference and use acquire MO for that so + that we synchronize with the dummy read-modify-write in + __condvar_quiesce_and_switch_g1 if we read from that. In turn, +- in this case this will make us see the closed flag on __g_signals +- that designates a concurrent attempt to reuse the group's slot. ++ in this case this will make us see the advancement of __g_signals ++ to the upcoming new g1_start that occurs with a concurrent ++ attempt to reuse the group's slot. + We use acquire MO for the __g_signals check to make the + __g1_start check work (see spinning above). + Note that the group reference acquisition will not mask the +@@ -482,15 +482,24 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + an atomic read-modify-write operation and thus extend the release + sequence. */ + atomic_fetch_add_acquire (cond->__data.__g_refs + g, 2); +- if (((atomic_load_acquire (cond->__data.__g_signals + g) & 1) != 0) +- || (seq < (__condvar_load_g1_start_relaxed (cond) >> 1))) ++ signals = atomic_load_acquire (cond->__data.__g_signals + g); ++ g1_start = __condvar_load_g1_start_relaxed (cond); ++ lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; ++ ++ if (seq < (g1_start >> 1)) + { +- /* Our group is closed. Wake up any signalers that might be +- waiting. */ ++ /* group is closed already, so don't block */ + __condvar_dec_grefs (cond, g, private); + goto done; + } + ++ if ((int)(signals - lowseq) >= 2) ++ { ++ /* a signal showed up or G1/G2 switched after we grabbed the refcount */ ++ __condvar_dec_grefs (cond, g, private); ++ break; ++ } ++ + // Now block. + struct _pthread_cleanup_buffer buffer; + struct _condvar_cleanup_buffer cbuffer; +@@ -501,7 +510,7 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + __pthread_cleanup_push (&buffer, __condvar_cleanup_waiting, &cbuffer); + + err = __futex_abstimed_wait_cancelable64 ( +- cond->__data.__g_signals + g, 0, clockid, abstime, private); ++ cond->__data.__g_signals + g, signals, clockid, abstime, private); + + __pthread_cleanup_pop (&buffer, 0); + +@@ -524,6 +533,8 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + signals = atomic_load_acquire (cond->__data.__g_signals + g); + } + ++ if (seq < (__condvar_load_g1_start_relaxed (cond) >> 1)) ++ goto done; + } + /* Try to grab a signal. Use acquire MO so that we see an up-to-date value + of __g1_start below (see spinning above for a similar case). In +@@ -532,69 +543,6 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + while (!atomic_compare_exchange_weak_acquire (cond->__data.__g_signals + g, + &signals, signals - 2)); + +- /* We consumed a signal but we could have consumed from a more recent group +- that aliased with ours due to being in the same group slot. If this +- might be the case our group must be closed as visible through +- __g1_start. */ +- uint64_t g1_start = __condvar_load_g1_start_relaxed (cond); +- if (seq < (g1_start >> 1)) +- { +- /* We potentially stole a signal from a more recent group but we do not +- know which group we really consumed from. +- We do not care about groups older than current G1 because they are +- closed; we could have stolen from these, but then we just add a +- spurious wake-up for the current groups. +- We will never steal a signal from current G2 that was really intended +- for G2 because G2 never receives signals (until it becomes G1). We +- could have stolen a signal from G2 that was conservatively added by a +- previous waiter that also thought it stole a signal -- but given that +- that signal was added unnecessarily, it's not a problem if we steal +- it. +- Thus, the remaining case is that we could have stolen from the current +- G1, where "current" means the __g1_start value we observed. However, +- if the current G1 does not have the same slot index as we do, we did +- not steal from it and do not need to undo that. This is the reason +- for putting a bit with G2's index into__g1_start as well. */ +- if (((g1_start & 1) ^ 1) == g) +- { +- /* We have to conservatively undo our potential mistake of stealing +- a signal. We can stop trying to do that when the current G1 +- changes because other spinning waiters will notice this too and +- __condvar_quiesce_and_switch_g1 has checked that there are no +- futex waiters anymore before switching G1. +- Relaxed MO is fine for the __g1_start load because we need to +- merely be able to observe this fact and not have to observe +- something else as well. +- ??? Would it help to spin for a little while to see whether the +- current G1 gets closed? This might be worthwhile if the group is +- small or close to being closed. */ +- unsigned int s = atomic_load_relaxed (cond->__data.__g_signals + g); +- while (__condvar_load_g1_start_relaxed (cond) == g1_start) +- { +- /* Try to add a signal. We don't need to acquire the lock +- because at worst we can cause a spurious wake-up. If the +- group is in the process of being closed (LSB is true), this +- has an effect similar to us adding a signal. */ +- if (((s & 1) != 0) +- || atomic_compare_exchange_weak_relaxed +- (cond->__data.__g_signals + g, &s, s + 2)) +- { +- /* If we added a signal, we also need to add a wake-up on +- the futex. We also need to do that if we skipped adding +- a signal because the group is being closed because +- while __condvar_quiesce_and_switch_g1 could have closed +- the group, it might stil be waiting for futex waiters to +- leave (and one of those waiters might be the one we stole +- the signal from, which cause it to block using the +- futex). */ +- futex_wake (cond->__data.__g_signals + g, 1, private); +- break; +- } +- /* TODO Back off. */ +- } +- } +- } +- + done: + + /* Confirm that we have been woken. We do that before acquiring the mutex +-- +2.49.0 + diff --git a/meta/recipes-core/glibc/glibc_2.35.bb b/meta/recipes-core/glibc/glibc_2.35.bb index ca7f630699..15179899d4 100644 --- a/meta/recipes-core/glibc/glibc_2.35.bb +++ b/meta/recipes-core/glibc/glibc_2.35.bb @@ -62,6 +62,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ file://0022-sysdeps-gnu-configure.ac-Set-libc_cv_rootsbindir-onl.patch \ file://0023-timezone-Make-shell-interpreter-overridable-in-tzsel.patch \ file://0024-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \ + file://0026-PR25847-1.patch \ \ file://0001-Revert-Linux-Implement-a-useful-version-of-_startup_.patch \ file://0002-get_nscd_addresses-Fix-subscript-typos-BZ-29605.patch \ From patchwork Tue Oct 14 14:43:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kumar Dora X-Patchwork-Id: 72259 X-Patchwork-Delegate: steve@sakoman.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 972F6CCD184 for ; Tue, 14 Oct 2025 14:44:50 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.web11.18520.1760453082550157571 for ; Tue, 14 Oct 2025 07:44:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=UrXAWbcs; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=2382047737=sunilkumar.dora@windriver.com) Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 59EAhUfr3483883 for ; Tue, 14 Oct 2025 07:44:42 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=v3LYSeS7obmo4+UmzI3SnA4fjc5rSHJhZM3+VZNf0YA=; b= UrXAWbcseHamot+8480222vOobhTm4xgmyGh7BIBjyVHjq2zrk/jPATPBRXVMRsq IgMUg2ntjLIjzisA5XXMDzbP+5CJ8CEzWmBnkkvqB/N08h5gtcHweS/YzQnzjemp PqlK1HdqHMyNqnP5Tu444XrLNsS+3OiilIq1awiqjyYOvXvl17ae3v4jymdgT9fZ 0ydx9nquR3G1wsj3w1gC7m3vB1pOytPZYGO5iIiBGyqTGuZ6fSULtTLMz2pDANOc TpaijLklsKd902OPP4zTEPLcHmHbulgGDhZtE89kZI3e92o5Aq2QjU3kgqZ0pijK nvG2jeMMl49j5See6JYrCw== Received: from dm5pr21cu001.outbound.protection.outlook.com (mail-centralusazon11011054.outbound.protection.outlook.com [52.101.62.54]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 49qjh1k3wa-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Tue, 14 Oct 2025 07:44:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xP9EwZ9SPJVkLy6ryGD77PDQ8UMXhSu19fFHWrM4BTebasStJ+/xVLlVPRuw9NcquPkLB/0QXQqhEz4PtElMOJpRwlfa/TpgF+4xGPHWUBJSbe1sqwMnEqpo5q2uqcSkp/urGPrhQOF/ZkKxrdsfwb9zUsf5r3vzU42ACIxRBnFv7OK5x8XkSZYataWzugKJ/Ha0izrUr91i6XGtO5jiB4hp2YIT3lC7jmMRmH92FaaAjq50nDMh7kaPT+ltayRdRl3xFnrHiW0KWTrUkPRRVRiPSesOqBpYINSoFchOdYeIMq/g4OkBxo8EFQBvhNTcB02W+IyZOXCdS9EkEzT4Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=v3LYSeS7obmo4+UmzI3SnA4fjc5rSHJhZM3+VZNf0YA=; b=HGmegIUhrqv5sgOBo9DgkiPKbetMtxQ0NLFX4caAfcjfAAvVgWRXO+IvIYGbnvR8VMbCIysjJu3+7GPIs7XjEpPMyMlu2X6Llplw1FU8zso3m6lsgP1RheMnKGxKUpwG9+NuNkFjDzQV4ak6UqZ4QXNOiofYeboFbgoxgjnDuk+lpulq/4AWynPDhgkM+oql46iRL052wkW9Mc/q+VqbNMfWPePYn/qXI9w1qkvRg/VhM9WXcycRs2s3NJhbrvMhmXq0V15qYLGKGuze8O4PQy7N5g0B7UVbq2siCRKlu2l4rQYSyWZzlnV4ioO3spYtREjrJ0Wgh/601U4LhjcHsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from DS0PR11MB7901.namprd11.prod.outlook.com (2603:10b6:8:f4::20) by DM4PR11MB6381.namprd11.prod.outlook.com (2603:10b6:8:bd::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9228.10; Tue, 14 Oct 2025 14:44:27 +0000 Received: from DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::9fa:eb3f:cf26:264d]) by DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::9fa:eb3f:cf26:264d%3]) with mapi id 15.20.9203.009; Tue, 14 Oct 2025 14:44:27 +0000 From: sunilkumar.dora@windriver.com To: openembedded-core@lists.openembedded.org Cc: Sundeep.Kokkonda@windriver.com, sunilkumar.dora@windriver.com Subject: [kirkstone][PATCH 03/11] glibc: nptl Update comments and indentation for new condvar implementation Date: Tue, 14 Oct 2025 07:43:39 -0700 Message-ID: <20251014144347.536537-4-sunilkumar.dora@windriver.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251014144347.536537-1-sunilkumar.dora@windriver.com> References: <20251014144347.536537-1-sunilkumar.dora@windriver.com> X-ClientProxiedBy: SJ0PR03CA0279.namprd03.prod.outlook.com (2603:10b6:a03:39e::14) To CH3PR11MB7896.namprd11.prod.outlook.com (2603:10b6:610:131::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7901:EE_|DM4PR11MB6381:EE_ X-MS-Office365-Filtering-Correlation-Id: 65ab394d-3b35-4452-3835-08de0b302cf5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|52116014|38350700014|13003099007; X-Microsoft-Antispam-Message-Info: Supbxq+D8RLqNv5xLEIu7BFmpGoQQznHzcIbNx+VLOwmYwVyV5Lf4hdCOF8Q17JIQCw40Q92zqUY+lc7Osz4evOMs+T2r6H3vc6JEp7Jrd76N6HXzdF3rsBIG7r7Yc5squL2k1ZugsixnO5nh2DopxTKgABr+mEX8T37h/iFB2pnmk4r0EcOfhlFOc69p2hGH/Rcg4M4xUhgWzY5+e2g6/Q4AR0YT43caxQLlpsHDquK/ZsatFGHBFmvgua0qr76RPRMtajoTB0XOyroFPbxswQjoOGG7CrVucX1+hbb8DmeJv4JasT8TvAN9y6auuCewnBzJ9rKFGdqO+/63/suYewUvulAvX86P+Toz9nbbSPu2EZtwvR/xXLkSN3TX5VhN3Lfh770z75SzaKNrIE4RgJjPzMFFFoZic5HUzHDv5HXVfjyuD2z9I3b1ngLmT4q778w0xKsGRDFleVHaiQKqTBQP9cfHN2fXfEMNez3oP9N36WTuZqTm+rmPGD9zx20gUziAN73vxs0aePaVmQn+amUHAVA4D59gBAV07sKGxJoG1l9E81PKqzL+uQbdkIvzD0QwtiMraY7jAx4wa3cmbTIWU6n+WxSAXMoIwap/3x1t4tX8cjJmw0MH7AF4hOR5Z2iQCIIz6MFl/nbQ0hZye7vyeejIo3K4UdlTJ9gOSwyW+bPsiPojPoPbmuO9FXK6ez104yLslNmcSo+f5bXvp5kiq7FNomsmu1oBrszhTXvPGTJCz1NHAcoGKnGfgG8FSdSNOZY54t46+DkeiATR7phkRjpBClEVKY1kWKSE19GqtLllxZBNnAJXMveCtySA+uWZw250BuKdWLEJ5vA5IBt0UULOBt1aX9tMu3KaMd7HpZK/LhVwOgr2wE9WY9/i4WXbwvi0bEsn8SsTihH4LA5rH9O9F+p8zA6e7kj+qiHzZOwzjXCoVRP1zrbJ8HOGD4ZXyva7JTZ84zWPqqaOr4Cxe0fs2DS5RbsFI5i9e9T/uaiY2uq/J76wfbKVQsjHW31E1twd4P67goz9cgxNAK2aWSPMPicWkYMxsgH91vWzuPc7AlvVTf3vy6kD3BkPUL5KBEtb1CUM0nsQkbS2y+rX3txgTCWHFk2aGIiTjjQA9oVCT8jntcL0RPKAfHMuBShqfZX8yT2oIxwAhRh8YZvT34RXS32bdR/mnG6JlmZuymL8zCfvYxSnQ1Aw6w9apNKz4kKRpWhHEAtclgRLzbkOsYw0F9Erg6qqo+WLssf3D4ZuWt56VTGwsaPHCPm4WFp3tkjvnvTQXJ8kNu/BZ4jGmJYXHh2ImhfCagj8A2YdnepcCK/hWXOsP24qv1spAEEA0vUCDB8UXk8mmVSlHBNOw5WmTim/T5+RxitTxRJAsOk5+2pWr1u53vndTU1/8o0my5biaHu90tIEKGk7EdMTk0TFYmCAjaI4ITeI0ReW/T96nFnfiYsEoNHd3NbuI2zJHVeYL5iaXObYog9Rg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB7901.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016)(52116014)(38350700014)(13003099007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZciwGTIRLGRMDwfnf0euJqRLadFTDK2BHFw3klXX5JHJAw1LJZbKbT1zOP1TASRjv0rZL3mpihFziugAZrYHYS9cj770syD/p3Ggy/w45x463ae9DgVk/G4SOdXs848leAjxTL/5BYV0g3taZYPNSjKbkls2W/bA5gYi0FgxBE6onwn4yeKbA2Pw4OwHFQc0FonscrDGfBDsg1RIda52PXtnsn90+vTYZOmVocfDKJtRHb4QvOO407nHmRTZHhkv3L0/ilVfa5iuac0KDO7TALvqaSpJapurBT6tvzn1gS84/gwWGdqR82D0zmdeoBohPGB5yU5NzWQsc6dMD0DPSyYFOZ8vdg2sxwsA8T5Ytoje9mKnEzEHbVmgDYpDSMpMLua3D3zxHdzYymaJHn7jo0xaCnQ0UvD1/kCo05EPwSd+NCo3BJtUpfAgFz7WcQsSfZeM7/ti7dNHJo7gbJCacdZ8IJbuCQ+VC9LAZRg4aI5tdMlPVfBFBLzRJgWHofoCVCQfRDnr9MegIGtP2HM3ogJlrIhVxuc9WsmSYzMtyIBaINEQxDsH4Es4Qu131JSLjglIj8Y9/+lI0LiajywnEo4pVjQCABeh5VFjpv0OEsVYkoToQI3+lXpyq/8SEGZdOup9lLKnYXXLRnCGNnWRqUyhbLaeCkKm0WXHPPVa3c9iXse+aiJlkwg5d+Q6I+hFoO2MnxbG9zD6wjEECLGp2YI4iibtdbKKuzJO7ypfPBLHH/gFRVEEGn4prjpaFQa6i2XjJC+HIxuyvMIkdOEL3MJnNIt8ESOVQRuNTciDR20DdZtK2MFQRiSg9vxNn7Q7jb36hPmvpL2kScyk+ebh29/apEG2f07yf2FrH4cEOJkhg6slOaYzDNjlXGTWCTHWHdeMeH8GNlsg9odripvO2gqCE2uYvowCtRFVUjgpjVxX7LkBp/gzHF7p0q5RsnfAvM4BlG5oD53DijlmtS3f68NqffEDv7RlWP75uFDOruxboVmjFeolbRgHZR1KXyx3K2kz+nXMKC4zVwN51tlAB/mPX4PvZYQ0tvOgR11a3A9CTUNv8ojCAd05IWH0DBxhcrJg8KcVuamWT3klov/DJGWNNuW8P8BjIisN4BFJ6Q79okEoMfttL7qkb0k/WaC9QtzUVpN+Ivk4csNd9ae4rznMpwR/KOomuKjdeFuBzp80WKL7oPaLCGoYSyeUMeOqFKF+G/iXsHxdU0/lruOO3tDfmlVbQNM8tan5b1Nrdr3sBUXYMwpzlGxd0SrYOti7OXYhkyoz3ccZXOkaqcqF/lsSmmk9qXUfRue8ylIBn7I6zF4M/t/t3HuTuDK63iY2RLJBDtrqtuOXiCvI3bnpaHRP491h9SzgkDD7LYdKOBZUFO1+ZPT2rJlx9IbgqrqJ/4gah9Q796GEB9Hza82iF1K7MMsc7hnOg4L2j1PfuM/Mp6mi6l9zxCz5IwjWX8SlsKt58E2swizyuviIlvZaWClIezjW0oAIw3ihPkqLEHdSfoWLeHiYihQnagmOZlEm2Jd+4qZf5k8ztbV5H6pBvjzJOiTOgWYtn+Yb4+wAB3ROZhOnA2LjtSQgfAFuxYmn9AkQX5bg8lMKLV/CWrboVA== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 65ab394d-3b35-4452-3835-08de0b302cf5 X-MS-Exchange-CrossTenant-AuthSource: CH3PR11MB7896.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2025 14:44:27.7321 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: l3/JZadRlGLEIfXkjI90mc+0kBLOvUGN8JOlvS3AW+SBsC6pBXmn8FvTkV1qw2dBjOlj6YcOkbdnmgI7XVKDDzgK5KEL8g6lmXstTyM/AEY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB6381 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDE0MDExMSBTYWx0ZWRfXxjhECM0lrRlx nn8ukwNGbZRP4IOqHbaO7nHPM934dZ5yl/wxcsCUA17h4SQ1NRglRxBvqOfrOBuDBnY6XxGypgL oogR96d4nQrTBbPzPN6tzD2ZLt8FfmG7PD3i5wxQkXd3jl+wLxDuXAxSPtMlQSkazt0PdFNVs1N 4/ZiajjLyQvtNIPkIeF8vATcm8gwKYoJKH9Lq5TEdOVqbEtYC6LbwPfVLbcCOMxFCRIJ0C0aKj/ y9ceUqxIPhFBmXeSjPisPWtUjQmYmAW62xE/wEsR7hKPtuEMQW/F80iPPuTvOlzCxeJL7mltzRU EDUkhz7zRayoy6jlv5LBJ3w4EDk9e2QbjZtSSTX+Bc2Hrg777ox4ur00YJ+eBHJtnIufZPGAzrn Fo5CTZWYkZhqnC9e4de0SZ5PE34Rww== X-Proofpoint-GUID: ANaUv13Zuu8oDg0n7dMH7FGtCLIZ5jAM X-Proofpoint-ORIG-GUID: ANaUv13Zuu8oDg0n7dMH7FGtCLIZ5jAM X-Authority-Analysis: v=2.4 cv=aetsXBot c=1 sm=1 tr=0 ts=68ee61da cx=c_pps a=7v6vjeP3yXOm/Y6ajRpg3w==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=CCpqsmhAAAAA:8 a=t7CeM3EgAAAA:8 a=uzjaQC1v_Til1Q9DAxIA:9 a=1-8MW9jiqbIA:10 a=ul9cdbp4aOFLsgKbc677:22 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-14_03,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 suspectscore=0 phishscore=0 malwarescore=0 clxscore=1015 impostorscore=0 bulkscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510020000 definitions=main-2510140111 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 14 Oct 2025 14:44:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224823 From: Sunil Dora The following commits have been cherry-picked from Glibc master branch: Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=0cc973160c23bb67f895bc887dd6942d29f8fee3 [2] https://sourceware.org/pipermail/libc-stable/2025-July/002275.html Signed-off-by: Sunil Dora --- .../glibc/glibc/0026-PR25847-2.patch | 145 ++++++++++++++++++ meta/recipes-core/glibc/glibc_2.35.bb | 1 + 2 files changed, 146 insertions(+) create mode 100644 meta/recipes-core/glibc/glibc/0026-PR25847-2.patch diff --git a/meta/recipes-core/glibc/glibc/0026-PR25847-2.patch b/meta/recipes-core/glibc/glibc/0026-PR25847-2.patch new file mode 100644 index 0000000000..a9ed702170 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0026-PR25847-2.patch @@ -0,0 +1,145 @@ +From 306ea7810f5f6709ef3942a7be75077203b5d201 Mon Sep 17 00:00:00 2001 +From: Malte Skarupke +Date: Tue, 14 Oct 2025 04:27:19 -0700 +Subject: [PATCH] nptl: Update comments and indentation for new condvar + implementation + +Some comments were wrong after the most recent commit. This fixes that. +Also fixing indentation where it was using spaces instead of tabs. + +The following commits have been cherry-picked from Glibc master branch: +Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 +commit: 0cc973160c23bb67f895bc887dd6942d29f8fee3 + +Upstream-Status: Submitted +[https://sourceware.org/pipermail/libc-stable/2025-July/002275.html] + +Signed-off-by: Sunil Dora +--- + nptl/pthread_cond_common.c | 5 +++-- + nptl/pthread_cond_wait.c | 39 +++++++++++++++++++------------------- + 2 files changed, 22 insertions(+), 22 deletions(-) + +diff --git a/nptl/pthread_cond_common.c b/nptl/pthread_cond_common.c +index a55eee3e..350a16fa 100644 +--- a/nptl/pthread_cond_common.c ++++ b/nptl/pthread_cond_common.c +@@ -221,8 +221,9 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq, + * New waiters arriving concurrently with the group switching will all go + into G2 until we atomically make the switch. Waiters existing in G2 + are not affected. +- * Waiters in G1 will be closed out immediately by the advancing of +- __g_signals to the next "lowseq" (low 31 bits of the new g1_start), ++ * Waiters in G1 have already received a signal and been woken. If they ++ haven't woken yet, they will be closed out immediately by the advancing ++ of __g_signals to the next "lowseq" (low 31 bits of the new g1_start), + which will prevent waiters from blocking using a futex on + __g_signals since it provides enough signals for all possible + remaining waiters. As a result, they can each consume a signal +diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c +index 1cb3dbf7..cee19687 100644 +--- a/nptl/pthread_cond_wait.c ++++ b/nptl/pthread_cond_wait.c +@@ -249,7 +249,7 @@ __condvar_cleanup_waiting (void *arg) + figure out whether they are in a group that has already been completely + signaled (i.e., if the current G1 starts at a later position that the + waiter's position). Waiters cannot determine whether they are currently +- in G2 or G1 -- but they do not have too because all they are interested in ++ in G2 or G1 -- but they do not have to because all they are interested in + is whether there are available signals, and they always start in G2 (whose + group slot they know because of the bit in the waiter sequence. Signalers + will simply fill the right group until it is completely signaled and can +@@ -412,7 +412,7 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + } + + /* Now wait until a signal is available in our group or it is closed. +- Acquire MO so that if we observe a value of zero written after group ++ Acquire MO so that if we observe (signals == lowseq) after group + switching in __condvar_quiesce_and_switch_g1, we synchronize with that + store and will see the prior update of __g1_start done while switching + groups too. */ +@@ -422,8 +422,8 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + { + while (1) + { +- uint64_t g1_start = __condvar_load_g1_start_relaxed (cond); +- unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; ++ uint64_t g1_start = __condvar_load_g1_start_relaxed (cond); ++ unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; + + /* Spin-wait first. + Note that spinning first without checking whether a timeout +@@ -447,21 +447,21 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + + /* Reload signals. See above for MO. */ + signals = atomic_load_acquire (cond->__data.__g_signals + g); +- g1_start = __condvar_load_g1_start_relaxed (cond); +- lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; ++ g1_start = __condvar_load_g1_start_relaxed (cond); ++ lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; + spin--; + } + +- if (seq < (g1_start >> 1)) ++ if (seq < (g1_start >> 1)) + { +- /* If the group is closed already, ++ /* If the group is closed already, + then this waiter originally had enough extra signals to + consume, up until the time its group was closed. */ + goto done; +- } ++ } + + /* If there is an available signal, don't block. +- If __g1_start has advanced at all, then we must be in G1 ++ If __g1_start has advanced at all, then we must be in G1 + by now, perhaps in the process of switching back to an older + G2, but in either case we're allowed to consume the available + signal and should not block anymore. */ +@@ -483,22 +483,23 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + sequence. */ + atomic_fetch_add_acquire (cond->__data.__g_refs + g, 2); + signals = atomic_load_acquire (cond->__data.__g_signals + g); +- g1_start = __condvar_load_g1_start_relaxed (cond); +- lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; ++ g1_start = __condvar_load_g1_start_relaxed (cond); ++ lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; + +- if (seq < (g1_start >> 1)) ++ if (seq < (g1_start >> 1)) + { +- /* group is closed already, so don't block */ ++ /* group is closed already, so don't block */ + __condvar_dec_grefs (cond, g, private); + goto done; + } + + if ((int)(signals - lowseq) >= 2) + { +- /* a signal showed up or G1/G2 switched after we grabbed the refcount */ ++ /* a signal showed up or G1/G2 switched after we grabbed the ++ refcount */ + __condvar_dec_grefs (cond, g, private); + break; +- } ++ } + + // Now block. + struct _pthread_cleanup_buffer buffer; +@@ -536,10 +537,8 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + if (seq < (__condvar_load_g1_start_relaxed (cond) >> 1)) + goto done; + } +- /* Try to grab a signal. Use acquire MO so that we see an up-to-date value +- of __g1_start below (see spinning above for a similar case). In +- particular, if we steal from a more recent group, we will also see a +- more recent __g1_start below. */ ++ /* Try to grab a signal. See above for MO. (if we do another loop ++ iteration we need to see the correct value of g1_start) */ + while (!atomic_compare_exchange_weak_acquire (cond->__data.__g_signals + g, + &signals, signals - 2)); + +-- +2.49.0 + diff --git a/meta/recipes-core/glibc/glibc_2.35.bb b/meta/recipes-core/glibc/glibc_2.35.bb index 15179899d4..732cb96f94 100644 --- a/meta/recipes-core/glibc/glibc_2.35.bb +++ b/meta/recipes-core/glibc/glibc_2.35.bb @@ -63,6 +63,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ file://0023-timezone-Make-shell-interpreter-overridable-in-tzsel.patch \ file://0024-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \ file://0026-PR25847-1.patch \ + file://0026-PR25847-2.patch \ \ file://0001-Revert-Linux-Implement-a-useful-version-of-_startup_.patch \ file://0002-get_nscd_addresses-Fix-subscript-typos-BZ-29605.patch \ From patchwork Tue Oct 14 14:43:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kumar Dora X-Patchwork-Id: 72258 X-Patchwork-Delegate: steve@sakoman.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0731CCD192 for ; Tue, 14 Oct 2025 14:44:50 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.web10.18462.1760453082939667823 for ; Tue, 14 Oct 2025 07:44:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=EPfIXSG0; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=2382047737=sunilkumar.dora@windriver.com) Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 59EAhUfs3483883 for ; Tue, 14 Oct 2025 07:44:42 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=vGMXj9VewZZ0OxcMzE/tNI8yKDNiGtGD/Bw9qe6bc38=; b= EPfIXSG0nyta66WsrwwbbGhRjkLccYFW6U8/P1rQQE6zMRus2aOuMQ26tp3094dc 3l15qXYH/GDbV4XgAlAQE6KuoF9qB6G70gUvRkUAYwNfJXtWpX0byy2C5ymbl0FS iJF9X8Aahq0qLryEnnlm/OdVpkuVMWPFmYon0VpdCI9vfsNjzzBIRcDHPwrw6PRi d+XIGrDa7nPYMqr3kfYD6aKQ2GBWA/i4a3liw4V9J0kdpnSE/P6BEF3jZ75WUHie GisvPv/biDfDrtlxnlsLvDQ/80hMXEmBDYdNnxqqVKtuQ/gTpd/FADZYImvohCFp rXc6cJa4dBDEnaroklOcPQ== Received: from dm5pr21cu001.outbound.protection.outlook.com (mail-centralusazon11011054.outbound.protection.outlook.com [52.101.62.54]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 49qjh1k3wa-2 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Tue, 14 Oct 2025 07:44:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Shd34IyznFfLNk1KMXntB1d8OO7unaiA52YF+bq23BX8HGxW4SiMO7DuOvLSSFPdqjICCpe3vDYjn1xfFIx57NndEiRXf28PAEdP0OyYMPlbIlz9zcdG4SSCIG5d711D99Pmqc770qN2CKbuSLMkusmjSPNxDG/jOxFj0YHPBvR6mkUxmKQr1ze9wpTETulRZa4L4tpgf/tuNoQk7VFMs4UsrsuY0WhhHVrEZbM/GmI21Bdkj0CNKAaG/lG27Lt44QtidajgBw4/0PshoPc54rLf78twh12mkvEP8mzyOWGFU8ly1kfyM4sHxcXHF27r5G3IQO4AqbpMJ8vp4JgSAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vGMXj9VewZZ0OxcMzE/tNI8yKDNiGtGD/Bw9qe6bc38=; b=ggmoR2HHi19yQY8jkkZVvowOb+gwBOJDM5+Jwm+D5vm65LH7Vgeg4vC2xjTdg2T9fmZx/xzwtRCEkdnf3VcT2y1vSqZoIojcpLUOl8KBdAfAHmwCH8Evr8JJMN7zImxxLXD3TQTpvqqdwK0Yk2/8LIaxax+x0Odt5ekWyz84Ih88FYYC3cXxQMPJGqQfl1vFDWCtVmDBfYlSOocCTlcXbKEYT5Zv0ctHwcbSZnAN/yWM1mmpiLFL2N8ZfdbxAdEVnMY8Iw6oEeoZCO7SsvdVR0hIh5eglj+38COcMTrKIoDi5PdT0WkWnRmg0NyrS5PjR6Ubl+4IywSJc5p0jjji6w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from DS0PR11MB7901.namprd11.prod.outlook.com (2603:10b6:8:f4::20) by DM4PR11MB6381.namprd11.prod.outlook.com (2603:10b6:8:bd::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9228.10; Tue, 14 Oct 2025 14:44:30 +0000 Received: from DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::9fa:eb3f:cf26:264d]) by DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::9fa:eb3f:cf26:264d%3]) with mapi id 15.20.9203.009; Tue, 14 Oct 2025 14:44:30 +0000 From: sunilkumar.dora@windriver.com To: openembedded-core@lists.openembedded.org Cc: Sundeep.Kokkonda@windriver.com, sunilkumar.dora@windriver.com Subject: [kirkstone][PATCH 04/11] glibc: nptl Remove unnecessary catch-all-wake in condvar group switch Date: Tue, 14 Oct 2025 07:43:40 -0700 Message-ID: <20251014144347.536537-5-sunilkumar.dora@windriver.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251014144347.536537-1-sunilkumar.dora@windriver.com> References: <20251014144347.536537-1-sunilkumar.dora@windriver.com> X-ClientProxiedBy: SJ0PR03CA0279.namprd03.prod.outlook.com (2603:10b6:a03:39e::14) To CH3PR11MB7896.namprd11.prod.outlook.com (2603:10b6:610:131::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7901:EE_|DM4PR11MB6381:EE_ X-MS-Office365-Filtering-Correlation-Id: f6ffd817-f2fd-48eb-2119-08de0b302eaf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|52116014|38350700014|13003099007; X-Microsoft-Antispam-Message-Info: VsqMk2FeXgATbtxJ7JDw404geHez2y12kL0s48P3mnF+y5bBfXyC4lVa8V43485az3nCyU4deC3dnFU81suQ0KBdWEQ8tJnF1oMYrqU5GKsrJMK4NUu9D3uq5CIDy4FYc9Jea/Dj7WY5uQTlOf6yq1XuQj9kZJ2frjTaOeNrmJFr5gmB2oB9ypstcJ/+4ioT2I1bpLflNzk0V/oI1cOwQUL5Man2PKS15H8Ej//XfRwJDH9SUpnZoHabzkap2J0cYMCZh62k1xrArT+COGA7civIH2YXQM3dgBK8F68feMLOwQaqoD1AJthWc2fDbe3NUI+n0pQjWifAkfxZ0UNEI+2ZTD7lWXR8D8M2MOwiNqMZSKlIUYUsWFgDYNptJEK1NmvJa2sPvhOls0Q3aQ0UhG6stIcdxyW6bJMMgjIrNq1XEXfz9d7y7Nc3gxW4yIXWe/OSljFyvJXrfrnEDDT1WKKZY2VU4ZxbrilMZdVUvEDKHLW1YPlX5kuYjiaDjpaHefpu2scpis7+ExpVAUbfVqAsbdXN6a6/ZuQPZYKzKcftXiXwuDfiKlEILX9Q+vMtZ2z2sErI3XBNWtpvDCd3gymyEPjsThBwLeqHoRDOYl/sAf/hhmWrMmtWZTiSJAIPVnKZBM8VY8sf19JEfr3kCKB5JMn7SoCNHEjBRzmL9OM4hOrX7JCPOFaLt2VqnAnagLLQ2NSXDFwgqpFRuB2MzNdhk42taGlau1RFHGy6LK/48TNzeqydIkRIeqsKBgU9QKSpZgrT8vPef5f2OUZRgILa3ex8UwX+i5wmPwCdJAo45AtYKAMvKZ1di79aaNHXlpuVjHjIwYM2lqTdVjxmH+1Skud8xptWZkkSBBUX4405231OFdIjz4DA0+mthyE56gcpEPpmv6q5qhL5jx17W1P0ie3bT3JZGNBkU8lroJdFqcT4NynEkG3jflOkZ7mWG05pTm87tB/wJIZpwvqMHArxT2Xf7Pb2d1AgsFzLbxNpcI9vNwl1b1SMZnkbsoILuMrRG7djajT5GQ0YrLdQISc8KeisVBhIvLFRdwV4jAtf739bff1769VCJG9khjVSgXaVfPgoM4qqTWANd99k7r0rZGJY0DVliU7kFyTmJnA5ErLgR+aPPKrWDCasPlRgm2czYaFLrNs/K7v5TZ6xTJXf8JJs/zUChPyr7uMMO5i3ijCJQVpoPat2RR4cLvIfxrHPLTkNSYyryTD2ePusExa3KcCCqM0SySczPosWX50mRzdQKFSFzFo0OmlpNF1Huop4kXyM0pkd0gNEt2DYKdQJbkdyL6ZsXPdCjLyvzud3z/9mklkCz4RflxBWj8IeCT/tAbeq3q97PJ/4ZRroWjDh/eiDTRWeblk9WQlnF6fiY+FXaoYSX6MzBlKPIrX/32TTk/w6jMqBXYyTc0xkGYHPBv9nYr8m15g3vPerhkQ4u/LGV98qciwmmbnZSf9Xq3FMRHg8smbe2uTqndYE2Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB7901.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016)(52116014)(38350700014)(13003099007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UJdTJsXEc/+r1l7t/DVcg93A3v8e4AA8eCMtbxzBvnFCa+mtC9uLebqVq2ffRwCjrwdICm3sSHW+BShipXXOc1RySE4tPHYFqaCcLmTRdWUA9nc8YN2/5DRLF5PfepLpOQMq2riBKXn31EjzVf6MFw5QgaQ/i1TTTPEb+RwhMATb3pwB1CkFwFkOwIJ5Frt4rlWEHRcPm5OLShTwgBaNiWkjOczU2DfSRp3Xb9aPohrwgrw5uy/JnZGd/R4QQsMW//6n5+Bv6VnwrRMSbcMaIE2cAi+AQiDaMZ2QsGOm3+rsXes63hQLWNQShrawDIMHlB9nLSiirWDNPPRoxhOlhgs32MpgPI5+JNb0pF4ji41RctPLZ5eJ3sH+fQg0jYYlK6ENR5bfa1a9CEUhCkgdIOngfv34uNwJ2c3zsw1POaLxeXaTRBt1mXzhqQZ3DkfnjXFCQnIESk20xZoZEGV5kgEVrBEB6d4QLTD/FLkPk8crrtWOkSpYEyaeG/VN7X/Iex3GtNGjIkIT80Zjn/qO39aQJAaZxGAeDvPoET9vK0gxpoOcA0XXlKwPW9bEGAGYhbHAdm0JWL8nTzdhGJ0e/+qJnyfpLQqntaIXgoM10BLy/kJ5+/Yr7OtB0poNMDcLPpGNz0Ii2dFZECthqOwNh/tfSLUXM6ad96twjxQ5NYPnh3TGZLyLgE/sEu1NBTiUBT4FxupyAhPlER8zmkrwsAOnXiWaddb/yoNdQofCWaqkgx5INccmCSRbQb+pOAA7L8Rgpic07T65Lqbuwa3kJz9QCWPFKyzuQbYHGHYTHw4X41ArQuNFF+BOSn0Or1dW2ApQcZ5j5ffkI6bsSiH9SP/NCt8dGkAiM0z7B666BkzG++9UwFYckhMVJqenmg/wrY3PmcHvKam2PGZj8krcwZ48aEs1d7SA0bwpsC0VTeLyvCTq6VATDPi2xTkTdKNezBpesZ8UuFSppCVbtGYu8JDH1J0wY/Aw7nBeb6IVvVfaPAMQvyy3+64EASXIul7ChvK1mNlkFrme4JKS3cWGXHzvwi85f9R8TI5WDlGou+ewIvxCgtA0kmdNNCcgeHUE7p02Fml8r4XmuVNS9k7EdUg1n7LeG/7bljWmGV3Rxac7FbvGjvpct1WZQ2lWDeCo1UlKqP1IDqmHFf7epiMFNDMZIzv4TV1VfZgAfOlGMCVnSls7fyhEj/3eDxyYmVkJUKSy4ZOzVgUz3aQcL/fYdpuEAt+6kEoWTTJ2RxPywCjL8b5yfI8vwVhVEFzv/mI7C+9ZAX74JPtHukHF+L/kwr9x0Vc+LfyWj4unzVJF6Ameyhi+ctDrtqQhWqHfBI2ncCMnmOHoXfb9n6w+PqCMcz4xKclYbiW4B6VUYfM8cY8JFPY3dyJoiDOskDtleyvmWYvMx25KHUZnSXRuDgehxfsip3z/ixYNWwnREiJkbOBv+0jNGlePBk1l6Nuctip2Re7Q9RxqOIpD2W7KGWumycD6VPwEG1fZdg5++A/0qj8A3ctITE1CYNFiPmENDSg/ah0aVuFkO4LfJvJ48lqWHrZm62Pg/UMF7mT6430r8amuvmg8O4bKwtMcCMvg6+qKlUonZF+8uDFQqFGELaowbAOME8tyxjnBheZ1c8HmNso= X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: f6ffd817-f2fd-48eb-2119-08de0b302eaf X-MS-Exchange-CrossTenant-AuthSource: CH3PR11MB7896.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2025 14:44:30.6373 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: F9D1tXaBaZtuFFK2tRDcVY1lZh0Q+7dmd3E57liLwH6aCLEM7UazQlJrQsalGikCIuejcO0/qifnpLpcK53HELOTigadBxJB40F8OpcBlHg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB6381 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDE0MDExMSBTYWx0ZWRfX6+93QcT09yus oFGEBMvbo5kymIogp7+0Cokqtot6Tk4Na1ZKZYdHNyDGxvoGveNg4rFLyVJXMB33Z5M3s7HHa2V dBe1Jh95R9INwLMGK3tGUDm4enfhVhv0oT+Dso05xcn088O521hi50XtnqWgYCiyAuDrpFWezcs CEKyB2Q2XTxbTJOhbibgjGbaWWB57MVTpglCVFZHHbbmFrzvYVRzV+4rUBVW1AU9pndKGsi0Cep nb6rx2aLXoV41Ma7yHBS5LP4kvcJHX/XCsmvF/E6Qcs/8s6i7Ga3mMe/hX6r/lEAqQ5W/SvE34k R9csRWuqVO6oChevmNVBP/hzIt3q5NzJCkHVpU0AuchYbhB/5wiWOiY4Td/QmWMlG5O+A6xcPSc nz5lOQA715a1v50MPj/bVqhkJ15tVQ== X-Proofpoint-GUID: WAMMlraCDM9oI-_ear1yVCWlhtvjvJTM X-Proofpoint-ORIG-GUID: WAMMlraCDM9oI-_ear1yVCWlhtvjvJTM X-Authority-Analysis: v=2.4 cv=aetsXBot c=1 sm=1 tr=0 ts=68ee61da cx=c_pps a=7v6vjeP3yXOm/Y6ajRpg3w==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=CCpqsmhAAAAA:8 a=t7CeM3EgAAAA:8 a=OTrzE_FXVTYtTbWwAisA:9 a=3K_-HASTV5IA:10 a=ul9cdbp4aOFLsgKbc677:22 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-14_03,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 suspectscore=0 phishscore=0 malwarescore=0 clxscore=1015 impostorscore=0 bulkscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510020000 definitions=main-2510140111 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 14 Oct 2025 14:44:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224824 From: Sunil Dora The following commits have been cherry-picked from Glibc master branch: Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=b42cc6af11062c260c7dfa91f1c89891366fed3e [2] https://sourceware.org/pipermail/libc-stable/2025-July/002274.html Signed-off-by: Sunil Dora --- .../glibc/glibc/0026-PR25847-3.patch | 79 +++++++++++++++++++ meta/recipes-core/glibc/glibc_2.35.bb | 1 + 2 files changed, 80 insertions(+) create mode 100644 meta/recipes-core/glibc/glibc/0026-PR25847-3.patch diff --git a/meta/recipes-core/glibc/glibc/0026-PR25847-3.patch b/meta/recipes-core/glibc/glibc/0026-PR25847-3.patch new file mode 100644 index 0000000000..4228be95d1 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0026-PR25847-3.patch @@ -0,0 +1,79 @@ +From 5f22e8cf95cf6b3b2e16ddb03820ae3e77fd420d Mon Sep 17 00:00:00 2001 +From: Malte Skarupke +Date: Tue, 14 Oct 2025 04:47:48 -0700 +Subject: [PATCH] nptl: Remove unnecessary catch-all-wake in condvar group + switch + +This wake is unnecessary. We only switch groups after every sleeper in a group +has been woken. Sure, they may take a while to actually wake up and may still +hold a reference, but waking them a second time doesn't speed that up. Instead +this just makes the code more complicated and may hide problems. + +In particular this safety wake wouldn't even have helped with the bug that was +fixed by Barrus' patch: The bug there was that pthread_cond_signal would not +switch g1 when it should, so we wouldn't even have entered this code path. + +The following commits have been cherry-picked from Glibc master branch: +Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 +commit: b42cc6af11062c260c7dfa91f1c89891366fed3e + +Upstream-Status: Submitted +[https://sourceware.org/pipermail/libc-stable/2025-July/002274.html] + +Signed-off-by: Sunil Dora +--- + nptl/pthread_cond_common.c | 31 +------------------------------ + 1 file changed, 1 insertion(+), 30 deletions(-) + +diff --git a/nptl/pthread_cond_common.c b/nptl/pthread_cond_common.c +index 350a16fa..f976a533 100644 +--- a/nptl/pthread_cond_common.c ++++ b/nptl/pthread_cond_common.c +@@ -221,13 +221,7 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq, + * New waiters arriving concurrently with the group switching will all go + into G2 until we atomically make the switch. Waiters existing in G2 + are not affected. +- * Waiters in G1 have already received a signal and been woken. If they +- haven't woken yet, they will be closed out immediately by the advancing +- of __g_signals to the next "lowseq" (low 31 bits of the new g1_start), +- which will prevent waiters from blocking using a futex on +- __g_signals since it provides enough signals for all possible +- remaining waiters. As a result, they can each consume a signal +- and they will eventually remove their group reference. */ ++ * Waiters in G1 have already received a signal and been woken. */ + + /* Update __g1_start, which finishes closing this group. The value we add + will never be negative because old_orig_size can only be zero when we +@@ -240,29 +234,6 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq, + + unsigned int lowseq = ((old_g1_start + old_orig_size) << 1) & ~1U; + +- /* If any waiters still hold group references (and thus could be blocked), +- then wake them all up now and prevent any running ones from blocking. +- This is effectively a catch-all for any possible current or future +- bugs that can allow the group size to reach 0 before all G1 waiters +- have been awakened or at least given signals to consume, or any +- other case that can leave blocked (or about to block) older waiters.. */ +- if ((atomic_fetch_or_release (cond->__data.__g_refs + g1, 0) >> 1) > 0) +- { +- /* First advance signals to the end of the group (i.e. enough signals +- for the entire G1 group) to ensure that waiters which have not +- yet blocked in the futex will not block. +- Note that in the vast majority of cases, this should never +- actually be necessary, since __g_signals will have enough +- signals for the remaining g_refs waiters. As an optimization, +- we could check this first before proceeding, although that +- could still leave the potential for futex lost wakeup bugs +- if the signal count was non-zero but the futex wakeup +- was somehow lost. */ +- atomic_store_release (cond->__data.__g_signals + g1, lowseq); +- +- futex_wake (cond->__data.__g_signals + g1, INT_MAX, private); +- } +- + /* At this point, the old G1 is now a valid new G2 (but not in use yet). + No old waiter can neither grab a signal nor acquire a reference without + noticing that __g1_start is larger. +-- +2.49.0 + diff --git a/meta/recipes-core/glibc/glibc_2.35.bb b/meta/recipes-core/glibc/glibc_2.35.bb index 732cb96f94..0787dfe236 100644 --- a/meta/recipes-core/glibc/glibc_2.35.bb +++ b/meta/recipes-core/glibc/glibc_2.35.bb @@ -64,6 +64,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ file://0024-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \ file://0026-PR25847-1.patch \ file://0026-PR25847-2.patch \ + file://0026-PR25847-3.patch \ \ file://0001-Revert-Linux-Implement-a-useful-version-of-_startup_.patch \ file://0002-get_nscd_addresses-Fix-subscript-typos-BZ-29605.patch \ From patchwork Tue Oct 14 14:43:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kumar Dora X-Patchwork-Id: 72260 X-Patchwork-Delegate: steve@sakoman.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9EAFCCD195 for ; Tue, 14 Oct 2025 14:44:50 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.web11.18521.1760453083414526125 for ; Tue, 14 Oct 2025 07:44:43 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=UK/5xD7o; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=2382047737=sunilkumar.dora@windriver.com) Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 59EAhUft3483883 for ; Tue, 14 Oct 2025 07:44:43 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=Etp46qnkUGsrm1GRrvVV+mn8zwgzV69BjuN1b93HmVc=; b= UK/5xD7o6qI/ELxGmwgfBvcP2IN4qWrfc4ArT6trYDWejD2MFESMRFUCUh5gMFJm x+TMbCi4nCY5YiMvwkGwxhXvV5S+qkbZNj3GOVllef417NfGM3MIcfnQrEn3JilB ufafoVarjqc1lsbKLpNTC2JVFG91QQ8C1Zrn7Shm14b6jM/6RtqHZp7mLCOm1nFP RKdaVgzxv8RMWi++2rUD9FR3OsTmdzPFfdp9FdUZjJYZVnZ2iD0OlxpcdRMFo9nK pTSXF2AJjzP3jdlIs9HjHZOvpMUQB0sZKzldNa73hzM3A63/J9WS0l4VBfvoPjoH Bazp8/+ChKHaDlMzQXvANA== Received: from dm5pr21cu001.outbound.protection.outlook.com (mail-centralusazon11011054.outbound.protection.outlook.com [52.101.62.54]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 49qjh1k3wa-3 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Tue, 14 Oct 2025 07:44:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NwQ6XY+E/SqYORwT6fS5doX+XhyRvr/jKajDSEhydoEW+3X0PeEtlAM/U/VcfavcUQozSri3/ySot6KtqCSaCHyMHtOWU7L+GNAdcSuroQT/wV3CswjiZmdYfLCxNxAlbb4f0LDvbgcd3V04ebgwPE3kLerOocTZZEl3xMr5C3aWYPKR4eVb0e0Jr1H+yEExqSxycc2NUWsICRUO5rgbHA7WNCZm+jt5ChX0m8NCssKJwVT1P8z4e/7C1WJxjZcfCP/CSYQsxO2n+Kh5ZJQjPvf00lv84CwIQP49W0AP7hvPAFa5zJ7ciaWpXDpGlSUaMvsMMQSV71JSgKkF81qRMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Etp46qnkUGsrm1GRrvVV+mn8zwgzV69BjuN1b93HmVc=; b=wBl5QxdM45hzxIDHF04/xpzq501R/QxMobcj9Ik8pU3bRdaHGg3GzadEaB9Qn5yy5kehdo02VuDKA+w3L2DFhBvYa6J7nm4XbcMErBjh4qw6PYy1CD1P1+uj5lPEZL7o6qzeKSqE+TIu4Fhk2LU/S7DCUJ8P1V34JVQfJI7ljYaWEneL00fSxfMCgTPqCRyXFSoNyUaX5NJc/OAOmPulsAnOKIeziaa0woCEjSJX2U9i/z8P2sm3tCnrpJYgykXJsQj4NMkEzpc+HCRx/RKbzrBc914c4lKcJhaCP1KA1v6yt0S5L9sK3y/sSIEDkLSNJpGfHbj70BfL9JUBkU7Svg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from DS0PR11MB7901.namprd11.prod.outlook.com (2603:10b6:8:f4::20) by DM4PR11MB6381.namprd11.prod.outlook.com (2603:10b6:8:bd::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9228.10; Tue, 14 Oct 2025 14:44:33 +0000 Received: from DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::9fa:eb3f:cf26:264d]) by DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::9fa:eb3f:cf26:264d%3]) with mapi id 15.20.9203.009; Tue, 14 Oct 2025 14:44:33 +0000 From: sunilkumar.dora@windriver.com To: openembedded-core@lists.openembedded.org Cc: Sundeep.Kokkonda@windriver.com, sunilkumar.dora@windriver.com Subject: [kirkstone][PATCH 05/11] glibc: nptl Remove unnecessary quadruple check in pthread_cond_wait Date: Tue, 14 Oct 2025 07:43:41 -0700 Message-ID: <20251014144347.536537-6-sunilkumar.dora@windriver.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251014144347.536537-1-sunilkumar.dora@windriver.com> References: <20251014144347.536537-1-sunilkumar.dora@windriver.com> X-ClientProxiedBy: SJ0PR03CA0279.namprd03.prod.outlook.com (2603:10b6:a03:39e::14) To CH3PR11MB7896.namprd11.prod.outlook.com (2603:10b6:610:131::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7901:EE_|DM4PR11MB6381:EE_ X-MS-Office365-Filtering-Correlation-Id: c680d045-e650-412b-d484-08de0b303018 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|52116014|38350700014|13003099007; X-Microsoft-Antispam-Message-Info: 0ztNHF4CtJYG9jqdB3BfcauV4pQO1uNVTor4qc95BEW7WqAq4hPx7WgAqySQRDIiQG+OUEHWasLWFehN5qfLMX4eBYTe2fkvSLuaRJPA67QyzExLFITUjZ7rNsjRcyq3zGwwDoum4BmdlsjYQy5NBUhQ4V17nacK1A+w2YylGDfsosvCkB7jS/Ds/pxgEJ/eg+x+jP9fBZHVlOj8U911ZA9xhGf+0B94ai9jbDYmf9xExNHk4wY/+As0iyRRbPIRu4KLsCEW3HKmAsZDYH+gAu7oDbXnY7ZFhrWB9KhLhlTvliR5TKoAsox2COASBM5HzeZ/V2JqaSIClPaJEXwCHejjkUePKHnSrVADdSe/GWLLZec3t/v8DkPT64EWVQp83DLUrWEDuGBBY26MAreW+DEXCpfhII4nBe7C2tTS8tFja8NCwX2TnO4xBJ546qn4ZQdOSq9LCuXZQj5cOF/ya6xtll3/KhCGh71M7M4TWEmmO0FcPhMgHoY/Hr71c8VlgxiqH/3186+GeJRuYDb+/Uk+T9T6LzYaZh7ym/z/Fp/TKSHkqHqp+QrxqcXOY+WaM+g6EYuGDik+DB6OpE3xu+1t414fQt4ywqZtfy7/CKkLD6604NF7RU573WwZFHa+r1GbegWIDw4/v/+Osp+Q3N2tXFg0Qosxc+iRY6xeYfnOUGl9JPQagAbVCTa2XJuBg6fFRuP0UtwtVXemQL6pWzyNmSU60z+UPpSceiKZwdA0SFBkdNm/F8MKP6j3C7dFNKzondTZ94yQyhxckmM9iU9KpT67aN7Ug6dwUGOcKxEaNtSgK62d7W3r8vHiHmcrFnNLrbRWljvIb2IPIZHstQIH45iZ1/bfrcWB7qU7ZYPkukuG0D4ucEPBWj9eNvtyrSFE+ebY4vmKTvLUSoFhN7u/KiK+bckjqQ7AYmlDwS37ATHQpNCwp2+0Hw0F9SGy1yIqD2w/7IUDrp2qk2y/DrBvpDYazFLczDSG5NclT6qkVL6eM2KLhT1kCFu++nckaScgyps1FlL79cBh+IbN2kriYPDa820rkK+WtSY5RIIcpUHQYfRDdJ7o+YvQhuo7ZDCBxqPU3OlZT4uq6DdxFb84JoSYExYMBtSWQRaZ8cwvAhqxURsdDRopPjHMnhd+dzvs51V3e2b8XdH/Lm2bvTAF4TlDGNEpmw/+mi1yfOCA+oj49onud/3kTM51T48fNEkbfqDDNkSq2qCzzpXfmRqsZfpTdxmcWcARp5JQ9wwEDfkyhegTJ9xrfsEjbRmD2ViFMXxpYdWNqX5hva8HI7R9j5KAdO2Sq3qaJR0EHK8SOEyE2PjNZ37VtpMIUZ2+m2Qib48lR5S5C7noXD0QPYPW8gbM1Zu+2U+IHgXPZMO7WMPPu/BtvTCmXYEFByh0nKIfJcC/uV32uxmITwX4121GmH20nJylCrzKS30i0nQxXj9u+y1OPNm+2kBOaEZncmdZqByRm7JclkudLAOlUw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB7901.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016)(52116014)(38350700014)(13003099007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 99EU9wGb5dA48PMGt/rtBH39gNF60Go46Tv/dyZgeu7BKjW5kmkR2vwFOGcV9ipvQpv1CRsSk3ZphfhwRjH+hNVTQWzLNCQCW/knZZJ4Gfk7/pesPbHek6kvQHC3iD+lT5MNXm/eX9UuPrHOT1iaQ90uWuvN7n6DOvceBOwz4QqQCwwWXnWsgqNAftajlWl9DTLOENjmcbqT5BgjXLb+NJYslvT1LpCXybSrM6IV9Qm7M0KR2qLtE9To0AQj8ZfeGWZnMKVNV6QW41nZ9AONTrvO6aXzk25PQsQunHMbKTmVm3946syZcdzXZd3wqd8qsnBmcpsNHKiJIOP4slm6JAlZC40K+KXElJ84KH+e0nqHoQN/KuwaUlLNQmHPfERWfdhOyOLXruHJ7v7sWAR8R6aAkfc4ny45WcckoDr2SPnPLk4w0OqZmiKNffIOQEeAgVOQxi03xnkFxqRxsiQP0Ko6xM7rN9eNxFGe1hciuO1g2a2ecsLXQ1BWScKTFZPxX/pM05kCuV+XE2W8dAG/lV8xbNGACiZBqtkLhCI5+nkIKpSqCviGJCRHC2zIU7YfbNSsojxxwmE7C5G+l8LVI3F1WXi8d/ORg6d/0QD7jNaBiLlDViqkAf2alPWKv9ly96gz2Hg69/HutwQmd2O3S2BJ2MBYu0tIv023Fyh2Cy9jEzpSOgm0xa/gt8AyeylcPXY6N5BLjGnowmemyGeA3ZwM4hkM3H4u/t7LIflabOY6KOjmGUBW3p1i4szenGjGaM1LpqkkNkXuOskrkdZQaBGU42QzJIAZlvFYbmTKpW/pis3o6B/NkooyR6yFfH3dhS+1ydlxmDSwmWSsWPelevA9qwtdETqKnAUvb3lj9545Tm6osWl6qxGpBXgF2wYiYuigMmZRxmnUYxIotqZl9ocRuxRc2nRXVfxHzBrLLDVWaYAsIck9wBKGhfTLCvtUwBXAQ4fQABniyLXPjONufpn7yaoW3hLkjK0JYgAgBYYTZo6r/ne43NqzOf0MC3ruXQ5YEw77RM9S+bjd0qVnO5b9s8jvlOGB6CJlys0gN0B1Rvmtfgb4KmNhMVuf4KsrTUcmHeOjY58wmIBwiaEdZJbnV1Kz4cEitJYz6SAlkZ7wyY72plSEUCuu515kn6+UlEFh83MX0w+HD6p/ACs10NO0IAJR6jgVoKnfpfpg7n2SBClNcIQnttzLQx4aDESakxiSz/LAaSfBrzYm3NlhcRnS9TFndkCSTgTm4vsgxTeKhpNrEr2EIkTsckd8mJqOLMPVi0oLNRidX1mbHbWMVpcVKdFtWe4L3yCy/IRSWWDfxRl3R3RyHUzrWo4CDUb7YJrPJ85rXMfuCSWAv4JDR9UTv4fyZXDjls8eCVHZNEy97TVgTHltLGXy+JVGzk601osi5/kFd3WkCExGEKlT+Pugk4rH4OYxbupy9T+lYrmpS7fbzFEfVWeP5dPQ8YL+E4YVbMdq5OSqODcxDeaTm+AHYqwdfz3BmQnlGK2aq975lEyijhPalboME27nUgswAV5XxMRoXpJG8Ra/vb53BbnteUa8JyGKHnOiCz094LnCU22CKaMPFLr9pkhm330W+ky+vEfEzEhhtM4bdIutcJLvyMt9BSZILlBmdKlZGic= X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: c680d045-e650-412b-d484-08de0b303018 X-MS-Exchange-CrossTenant-AuthSource: CH3PR11MB7896.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2025 14:44:33.0190 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Hz09txHAKaaI/qFQltTICqk1exNdGw0AUK5VqgFnbqIbU/xHmG+c39fZQxy3eKXFdA9F1ELOFZH0SjLlhE3oVFtihg8947IQ2fqM7QwrC34= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB6381 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDE0MDExMSBTYWx0ZWRfX9IpCRGVHrmGr 2XBRZV41xfEIR7sKjfGoYZL9DMweKixUla00wdu+yAgDncFw9q4bMkAT5eyf/QGLxfOg+x8p6A+ GOyyN5jpbZiTVX+uVfsAZvNOBLr2igCKFn0IDx+HFIJzT1pFECEj4LXwQsT2ANDKPGSKiEnwWJW 4yShqzV/cbIryRi/I7TYCxM+Tfwj8p4YAJHOWwp7w7GPLw9u+a92IPNQhsPfYKfqJMdoMoRthkA tndzh+i76XZ7dnSE58N2eHXyZIHEM3Wc9mYMj3n4RMOACDKE1tvxIKYFcLbhza8b8+J6EanHcSw bY7D7mPwuph5WyvuK9NAeyMkUCC2Rkg4A1iPoXsMG5mE1DsgnC9i42tXDbnRuhPtv8ra6whQPuk /SHBDFmajRYItN4Igxyw52jC6l2QMg== X-Proofpoint-GUID: 3TG_uGEl5kZMY9P7prWdMNtTLBJqlS0P X-Proofpoint-ORIG-GUID: 3TG_uGEl5kZMY9P7prWdMNtTLBJqlS0P X-Authority-Analysis: v=2.4 cv=aetsXBot c=1 sm=1 tr=0 ts=68ee61db cx=c_pps a=7v6vjeP3yXOm/Y6ajRpg3w==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=CCpqsmhAAAAA:8 a=t7CeM3EgAAAA:8 a=NpP8qUlCxzQSevXvkUwA:9 a=J_S6sDf7mcgA:10 a=ul9cdbp4aOFLsgKbc677:22 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-14_03,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 suspectscore=0 phishscore=0 malwarescore=0 clxscore=1015 impostorscore=0 bulkscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510020000 definitions=main-2510140111 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 14 Oct 2025 14:44:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224825 From: Sunil Dora The following commits have been cherry-picked from Glibc master branch: Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=4f7b051f8ee3feff1b53b27a906f245afaa9cee1 [2] https://sourceware.org/pipermail/libc-stable/2025-July/002276.html Signed-off-by: Sunil Dora --- .../glibc/glibc/0026-PR25847-4.patch | 118 ++++++++++++++++++ meta/recipes-core/glibc/glibc_2.35.bb | 1 + 2 files changed, 119 insertions(+) create mode 100644 meta/recipes-core/glibc/glibc/0026-PR25847-4.patch diff --git a/meta/recipes-core/glibc/glibc/0026-PR25847-4.patch b/meta/recipes-core/glibc/glibc/0026-PR25847-4.patch new file mode 100644 index 0000000000..475462c880 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0026-PR25847-4.patch @@ -0,0 +1,118 @@ +From d714165c8bb3cac420077cfa61e3df87ea7f8b2c Mon Sep 17 00:00:00 2001 +From: Malte Skarupke +Date: Tue, 14 Oct 2025 05:34:06 -0700 +Subject: [PATCH] nptl: Remove unnecessary quadruple check in pthread_cond_wait + +pthread_cond_wait was checking whether it was in a closed group no less than +four times. Checking once is enough. Here are the four checks: + +1. While spin-waiting. This was dead code: maxspin is set to 0 and has been + for years. +2. Before deciding to go to sleep, and before incrementing grefs: I kept this +3. After incrementing grefs. There is no reason to think that the group would + close while we do an atomic increment. Obviously it could close at any + point, but that doesn't mean we have to recheck after every step. This + check was equally good as check 2, except it has to do more work. +4. When we find ourselves in a group that has a signal. We only get here after + we check that we're not in a closed group. There is no need to check again. + The check would only have helped in cases where the compare_exchange in the + next line would also have failed. Relying on the compare_exchange is fine. + +Removing the duplicate checks clarifies the code. + +The following commits have been cherry-picked from Glibc master branch: +Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 +commit: 4f7b051f8ee3feff1b53b27a906f245afaa9cee1 + +Upstream-Status: Submitted +[https://sourceware.org/pipermail/libc-stable/2025-July/002276.html] + +Signed-off-by: Sunil Dora +--- + nptl/pthread_cond_wait.c | 49 ---------------------------------------- + 1 file changed, 49 deletions(-) + +diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c +index cee19687..47e834ca 100644 +--- a/nptl/pthread_cond_wait.c ++++ b/nptl/pthread_cond_wait.c +@@ -366,7 +366,6 @@ static __always_inline int + __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + clockid_t clockid, const struct __timespec64 *abstime) + { +- const int maxspin = 0; + int err; + int result = 0; + +@@ -425,33 +424,6 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + uint64_t g1_start = __condvar_load_g1_start_relaxed (cond); + unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; + +- /* Spin-wait first. +- Note that spinning first without checking whether a timeout +- passed might lead to what looks like a spurious wake-up even +- though we should return ETIMEDOUT (e.g., if the caller provides +- an absolute timeout that is clearly in the past). However, +- (1) spurious wake-ups are allowed, (2) it seems unlikely that a +- user will (ab)use pthread_cond_wait as a check for whether a +- point in time is in the past, and (3) spinning first without +- having to compare against the current time seems to be the right +- choice from a performance perspective for most use cases. */ +- unsigned int spin = maxspin; +- while (spin > 0 && ((int)(signals - lowseq) < 2)) +- { +- /* Check that we are not spinning on a group that's already +- closed. */ +- if (seq < (g1_start >> 1)) +- break; +- +- /* TODO Back off. */ +- +- /* Reload signals. See above for MO. */ +- signals = atomic_load_acquire (cond->__data.__g_signals + g); +- g1_start = __condvar_load_g1_start_relaxed (cond); +- lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; +- spin--; +- } +- + if (seq < (g1_start >> 1)) + { + /* If the group is closed already, +@@ -482,24 +454,6 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + an atomic read-modify-write operation and thus extend the release + sequence. */ + atomic_fetch_add_acquire (cond->__data.__g_refs + g, 2); +- signals = atomic_load_acquire (cond->__data.__g_signals + g); +- g1_start = __condvar_load_g1_start_relaxed (cond); +- lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; +- +- if (seq < (g1_start >> 1)) +- { +- /* group is closed already, so don't block */ +- __condvar_dec_grefs (cond, g, private); +- goto done; +- } +- +- if ((int)(signals - lowseq) >= 2) +- { +- /* a signal showed up or G1/G2 switched after we grabbed the +- refcount */ +- __condvar_dec_grefs (cond, g, private); +- break; +- } + + // Now block. + struct _pthread_cleanup_buffer buffer; +@@ -533,9 +487,6 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + /* Reload signals. See above for MO. */ + signals = atomic_load_acquire (cond->__data.__g_signals + g); + } +- +- if (seq < (__condvar_load_g1_start_relaxed (cond) >> 1)) +- goto done; + } + /* Try to grab a signal. See above for MO. (if we do another loop + iteration we need to see the correct value of g1_start) */ +-- +2.49.0 + diff --git a/meta/recipes-core/glibc/glibc_2.35.bb b/meta/recipes-core/glibc/glibc_2.35.bb index 0787dfe236..f9086c0855 100644 --- a/meta/recipes-core/glibc/glibc_2.35.bb +++ b/meta/recipes-core/glibc/glibc_2.35.bb @@ -65,6 +65,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ file://0026-PR25847-1.patch \ file://0026-PR25847-2.patch \ file://0026-PR25847-3.patch \ + file://0026-PR25847-4.patch \ \ file://0001-Revert-Linux-Implement-a-useful-version-of-_startup_.patch \ file://0002-get_nscd_addresses-Fix-subscript-typos-BZ-29605.patch \ From patchwork Tue Oct 14 14:43:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kumar Dora X-Patchwork-Id: 72261 X-Patchwork-Delegate: steve@sakoman.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADA56CCD197 for ; Tue, 14 Oct 2025 14:44:50 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.web11.18522.1760453084462217219 for ; Tue, 14 Oct 2025 07:44:44 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=TE21ff2o; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=2382047737=sunilkumar.dora@windriver.com) Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 59EAhUfu3483883 for ; Tue, 14 Oct 2025 07:44:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=9vt1BQv9JO38EFlSHTPNTdJKA+JXXgN98DEo30igjsU=; b= TE21ff2o6NYCvE4F3c/mFjVdglnZ6YfhcvmgmOTdLcrIysFLc9800VRBoF5wckLE NnbKcfU1Xb5CE9xkRE2RvKcWqO2MfAdMRr8GqTsR4FPnjKov04kfoSRHJdP4Vss2 f5zq/B4NCOlEQALY9+XdldInr7CtFSd0jtu2w3trjl5B+VVP66T0QwAgJei2iBwF tt8/5p7a+f1w0rO+0otXKHip58w/WOEN7kByC20MExlUg/omn0QtrUIMqS/4laBP EAt2Uomg+fZw9Iju/TR4sesXW+s/sv1Ns1/WxSyQtkk+QYQyh40emoxZqsRV7ZW6 b4T70NwUDpOLVvN6jewMJA== Received: from dm5pr21cu001.outbound.protection.outlook.com (mail-centralusazon11011054.outbound.protection.outlook.com [52.101.62.54]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 49qjh1k3wa-4 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Tue, 14 Oct 2025 07:44:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vmHtc4wdQP6T8zbYxuvvVjxwjnpf4V56miQDi/+kZOTQivqw/eYPMueQPb2bPEmdc6K2zwW5PUHx4ywpLNjsU+kFlKqI8vJW1QTjJjAVIZvgUhV89sod6IoTUZZEmxKpW7YKKUEyIdB56N+sbe0D8Nf40V03byqY+sszV/rb6rg/6TPFt/9Jf1TEs0g5/AL4mTy8DACQMZ0wnmuOIsDKSUJQuAoH9bFkeVtiQuFFIatgN9fKd0nCNvFd+JJZ38ORpx5Ou6sj5PhrO/kJ0zPh0kgrqogvhT8/xk+Nvh3pLWkez60giyVIsVywA9l4JCGp2JE+OjC4ZPkU8J6xhIpCBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9vt1BQv9JO38EFlSHTPNTdJKA+JXXgN98DEo30igjsU=; b=KFl+n/BH9mY8dcXsPCXAWwybWNemN+K3DSr5e2wGtN5f6eAdsaLv8RM8aiWJEfeSV5a0zZw4+M4+pbMPbxPggRA52X+Ytm9VH7Q7HkgAlx833FkTEJgXtC2zCb8XEa/q+giJSbjU9Wq6NJDlsHduVFUzoatDGSDKiRK0ltdvtUnDU/G2wOAnBv4gWBeNMlVLlf0fKNdIAboOidYQho2al7gyppPv4pNwq83baCeXnHTgsdcCjnwY7Raxdxj9szML7o6ewmrJ5ISg5qaU2mMMFMYPDshXNCf1est02jBd79Ou1eg8+6DB/nC336n27msvmh+I83v7UMRTZCd3+T/X4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from DS0PR11MB7901.namprd11.prod.outlook.com (2603:10b6:8:f4::20) by DM4PR11MB6381.namprd11.prod.outlook.com (2603:10b6:8:bd::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9228.10; Tue, 14 Oct 2025 14:44:36 +0000 Received: from DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::9fa:eb3f:cf26:264d]) by DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::9fa:eb3f:cf26:264d%3]) with mapi id 15.20.9203.009; Tue, 14 Oct 2025 14:44:36 +0000 From: sunilkumar.dora@windriver.com To: openembedded-core@lists.openembedded.org Cc: Sundeep.Kokkonda@windriver.com, sunilkumar.dora@windriver.com Subject: [kirkstone][PATCH 06/11] glibc: Remove g_refs from condition variables Date: Tue, 14 Oct 2025 07:43:42 -0700 Message-ID: <20251014144347.536537-7-sunilkumar.dora@windriver.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251014144347.536537-1-sunilkumar.dora@windriver.com> References: <20251014144347.536537-1-sunilkumar.dora@windriver.com> X-ClientProxiedBy: SJ0PR03CA0279.namprd03.prod.outlook.com (2603:10b6:a03:39e::14) To CH3PR11MB7896.namprd11.prod.outlook.com (2603:10b6:610:131::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7901:EE_|DM4PR11MB6381:EE_ X-MS-Office365-Filtering-Correlation-Id: cf9344e2-a7de-430d-84f5-08de0b3031f6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|52116014|38350700014|13003099007; X-Microsoft-Antispam-Message-Info: ySvbzBYUThI/njTPD3HkBGNiyqvngUQ2h8s2OmEAFZoZH6Ei/nJWIjNqbXtaVKlnQL0xFd8Zqp8CtrMjgqsbfUfDWj/pixYBwsfqajCpoA6ofd/iwx1h705DDtEO+bx5CkLD2CuW4A5KDtwHvKg5qh6v0+kT70etVLXGH9B0MGs/wpi9u25OC1u1FR4l6EN6H8XIi+WRk/cYx8hC8JR0QVRLqPolHfF+kyPwOChrTs4VRDCTXxm4aYlBZIlaoaIDFR4HcuB/5B3oUm+SARGHKgRtRPQjfpTomgOVHvTulILuqyt1v7j25hSnU25icEcQVJrz7C/9zRR0qfPyTpD4uf4Uil2ciTYTg9S8iNVV0yfeX3P68+JQ45j5+n4UGNG/zVGaGEDUawnvIASNbHIPSS7bKJkVw0kAdGs/08FBUFzNNNbHAF3YYJRzwMiY/msfSAz4cCiItwQ2UAY5k2Qys00X8dKCV+IwL3nNrkRRzpmeR1SG77gRA84HgqFkM8TtFV621gumEmECfAHmUz+369FKAjMx1ItlI+I28RFFDL0pGS10SOYng1qup/ua4O0+zoLgcRh7qCZfeBFOAIwL0r7i7hcD9md/Od24cjArfz3STZX3k3HiA53jcG4AMh11abzH6WQ7gYLSPoUJpc60Pj1pqAQbCm6iqU1k6FjrbLmaGhVfdR0K/LPG1Efcl9s+J8OAaS71MDXaenJLkoyM1FzaC0IsYaVYw7B/k6EP36JwYei+nmoSJ/Eevb6KtdldWV40sQ4CxcqQjEfbZvs//Tv4e6UJyqQRwMsAeh47dCcbah5VxAcFFpRxIWiwbb1FQjmZKino3k0M2f17gDxjInrEWsZJ8JaH3Kyx5VYRwI0pfXfdJ6mo9wdfg7AUuHLWDRWri0Ioin+Pqt8yAEnzstsR1Z5DZCvcYuTRhYS/PVf4vRCSUr/lKFbHiyOCwpxmcAiWpXDTiCT4+qgDO/VfuR22DoM50Rn9z53frh8YbPx3f5ecZ2g6C05Gwu9CM1DYuULAZJ4h0WNq9G9KzRxrtWJGLQe90XY4VpKDPcKW+mOXcCBfngtVnsEiT8nei6ZdKdQBmxkry4jnNTI0Etz5ccWKzYrU/oohPABgPnPzB/h9TDMpglVjT16yuyyDoaYHPPZoQ+Sfk3Uu0pyx9hvsAsBilnk7mtUifklyvFky9G0ey0ILYQCKc7T/SCDMbkgsFVLevxpKU9nBpUehmOxPjtEglJ2eCF9zcbO5KbQSyMhY552yePiT0oMfeZM7OhsLaMlciI8ktD9kRxfJJqUSTKnHR/3204slE6UFuOhZYFN9uBZc2u7sjs+pwGjEXcesb4uwwVJ442Q0hFw9hsg8/qAyQ+vBJ1P9vDT80itkxQBs1tjjvumAgEHfqWdMLgqdFFt68+3YfwMWm5lPgd778goiMOJuCgtwsQOvo5b9ZBsK6+oBN3zHeCqNgbMuHBzOGqSdsvG9S0hRZdXJsdThZg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB7901.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016)(52116014)(38350700014)(13003099007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XHNvcF2OdQ05PN7Ip5xtlrkCnZzIWTs86HSYIFzDPQqXj+U84z328gxQsV84b54jeZ2B9JD9YScoP5G/3CRr67oQpuN9TC2y42Ho/eSfZ7Lc8ejAloGQpadb7n99f39KJ5dOEIAF6UJFavMTRZylyzRLH+isBDba8beIQnHa+WJbu5iqBeZMXmVjFYAzzAgAcNhMeR3o1Ca9arLJKBj+h82l8TmPuYPsp6E+uAX4HSkuk95kyNZWvBSvSYfk2CV+/GQ5spiAmMSTQq032sLGfXToWaTyeznADKkXBRg5p16cOOHEzxeY4KL+7CbzYEFOPs7Q0zk51yHGQW8tq4sLDKxLakVUhwP5iwuth1zkwV4O6VOOVr+rqKPBXsPmDTzPF8hymtqXGtoq54Jv8CpzH9/mN6i02NB8iD7FSl+nhMP2VgUxN9ZBkJGi/gzfIXfRVjGJG7YJC8WGe0WCtnsvUt3OEjm8MjrwBq1/hIRiGzlMYkyItFP/xtulJZlgKjtMm4B8NXkCzpRG6B6+MrddfSyb/RM7QwiLqLU0G4Y0mxE88Eoyo4Um5x2MfrW6hQzpT/tufaviTX3Ll3iHFeBEEoEFT4KfqZ5sz7uCISC5b50Hygr8a09sH2w3IiePDV2U1aSxGoAQSqNr6c8ndrtL0JYYXS39sd7v2nbXeci4nETzNFUQ+rvt88zNrGOuGt4ChmHjM/gWEvRzg3WPsup3jCwxaq6LHbDxVrotZhFqtRsDSec8wl1p3FkwHZffBg8qstTBsbYpimBr/8TvU9/Z8Qff7lvXhG2hPXyruMMmFxBA4lMijAe0F7R2J83eayM9oZaGLd5LAXXlAb/DnL5TBGEGErZ0cjnngRlm96nhrq/nPY0weA1J7idQywHQrkhcvD/LjdvK2waSIe7Jmv3/SR8cJIAJbyEPfHRmwMg9TQipo8F6ll6mZN2pYKj45F71KRbnVVpEc9Lrt38S64qzEA9xnvTWuFyrMqEMxEB8pdYMob7MUvOdXKLwNKMgPqbcf+614FAwCmquWDlFqnoP5d1qKm4fI/ELPGqPxNtyofM5A1PO9tgRnGZb/TPwX1VnMio9LXC10BaG8HzvzxKn0mweT+3tVdTDks6S6x7luxDqnpfJQ59n0HKWPtH4dW7bLKfD/tXG4iE16+wyWlXp1u112A2FIUr1YVdDfcTgjQcFl3/6d0k0Shn2dwVQGZDdGz+7RDxKlQxa8pLT6Vw3WOcgdiASsKKChsYqWzq13fDYFx599nSeePHZT9oCctQoz3Lyg0dkJiFqOdDjixILle5Aww/qFIAHxs27latfTqgSbv0qncbe3RANozEV8z4dqWXwRUodI58fO7dT/qk6w57/Q3jmFntJKOGJYJCRI4qc8yudiBX1IqAEFEM8djMlZaGfFqciyvFIJRRX173H5ft/HtL/w2oavF8o2zE1+VCTC/cdVqWxw0X+8eZA+5VGrMRneDReYLcjNMeSaOMDVPJlQcrBQ2BJtOsWfIAuWIPXFxnjQWomDjtvTubcv9wuDkouJpI8tfgQOGiAgKEYJSnyhumSPZgvcEi/fR+tftaFIh/FXejA68Ua/A9dPejsS9PRUC3isrwsKsUEFz8QIojAhlqrjpmFTx6S79D8GSk= X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: cf9344e2-a7de-430d-84f5-08de0b3031f6 X-MS-Exchange-CrossTenant-AuthSource: CH3PR11MB7896.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2025 14:44:36.0542 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FJz+xUTlgBBWUhymSx3yoGxZYm47OF/aqiDRX+PFgtvnwC6Q17+Y7gJ4o7YNxgmHEjXS+Z/R2QXTfo8YsIeZnIvetB6oePVZuvCEdwM+S+Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB6381 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDE0MDExMSBTYWx0ZWRfX54hdnOWJI9JN Y/WEyEX3YGPe4SaIGPqMjd+BHeM7w7VFLjIapPf0jcDHtVaUMPkrZUXVobZVInBTmA0Y2fobEWg 0zY0QosknDLx8u9j0wJH+aCABnHYsz7W2XfVHky163yL2gBAYhGHXTQBhJ1n8Bmeo4mSXViyM0F 8guuEP83efSxfaFSdGN0ZB7HjSwtIgrhQrf3qAUKgHJxDkGYUsKHcxQ5KTfl3SSlSfX9bG5k/cu 5X4Ly+o6eZ91InrMnXFqCUJeWOyJH9SX1IOnunhuysxS+NUvqu/lPikJ6s+JjUCeBWiZM7D5bS7 yozMuzVL5pZVlCnf9xVf+a5rS8Q2xvadWEkPLhayP8lTrNUdo18rWaGKp9iIXwjH+usqUU89wOm kARcGhgXzsnm5KFBkZhpX5/akpoNzQ== X-Proofpoint-GUID: WqoNKqgkSm-6DVpJsYXqD-T7s1swNOy6 X-Proofpoint-ORIG-GUID: WqoNKqgkSm-6DVpJsYXqD-T7s1swNOy6 X-Authority-Analysis: v=2.4 cv=aetsXBot c=1 sm=1 tr=0 ts=68ee61db cx=c_pps a=7v6vjeP3yXOm/Y6ajRpg3w==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=CCpqsmhAAAAA:8 a=t7CeM3EgAAAA:8 a=7OpmKx5D2OvMmZ34HLoA:9 a=xzAyb1i-fe4A:10 a=ul9cdbp4aOFLsgKbc677:22 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-14_03,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 suspectscore=0 phishscore=0 malwarescore=0 clxscore=1015 impostorscore=0 bulkscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510020000 definitions=main-2510140111 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 14 Oct 2025 14:44:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224826 From: Sunil Dora The following commits have been cherry-picked from Glibc master branch: Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=c36fc50781995e6758cae2b6927839d0157f213c [2] https://sourceware.org/pipermail/libc-stable/2025-July/002278.html Signed-off-by: Sunil Dora --- .../glibc/glibc/0026-PR25847-5.patch | 188 ++++++++++++++++++ meta/recipes-core/glibc/glibc_2.35.bb | 1 + 2 files changed, 189 insertions(+) create mode 100644 meta/recipes-core/glibc/glibc/0026-PR25847-5.patch diff --git a/meta/recipes-core/glibc/glibc/0026-PR25847-5.patch b/meta/recipes-core/glibc/glibc/0026-PR25847-5.patch new file mode 100644 index 0000000000..e50e942471 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0026-PR25847-5.patch @@ -0,0 +1,188 @@ +From f904a81ff8d0469ceaf3220329e716c03fcbd2d3 Mon Sep 17 00:00:00 2001 +From: Malte Skarupke +Date: Tue, 14 Oct 2025 05:59:02 -0700 +Subject: [PATCH] nptl: Remove g_refs from condition variables + +This variable used to be needed to wait in group switching until all sleepers +have confirmed that they have woken. This is no longer needed. Nothing waits +on this variable so there is no need to track how many threads are currently +asleep in each group. + +The following commits have been cherry-picked from Glibc master branch: +Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 +cmmit: c36fc50781995e6758cae2b6927839d0157f213c + +Upstream-Status: Submitted +[https://sourceware.org/pipermail/libc-stable/2025-July/002278.html] + +Signed-off-by: Sunil Dora +--- + nptl/pthread_cond_wait.c | 52 +------------------------ + nptl/tst-cond22.c | 12 +++--- + sysdeps/nptl/bits/thread-shared-types.h | 3 +- + sysdeps/nptl/pthread.h | 2 +- + 4 files changed, 9 insertions(+), 60 deletions(-) + +diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c +index 47e834ca..8a9219e0 100644 +--- a/nptl/pthread_cond_wait.c ++++ b/nptl/pthread_cond_wait.c +@@ -143,23 +143,6 @@ __condvar_cancel_waiting (pthread_cond_t *cond, uint64_t seq, unsigned int g, + } + } + +-/* Wake up any signalers that might be waiting. */ +-static void +-__condvar_dec_grefs (pthread_cond_t *cond, unsigned int g, int private) +-{ +- /* Release MO to synchronize-with the acquire load in +- __condvar_quiesce_and_switch_g1. */ +- if (atomic_fetch_add_release (cond->__data.__g_refs + g, -2) == 3) +- { +- /* Clear the wake-up request flag before waking up. We do not need more +- than relaxed MO and it doesn't matter if we apply this for an aliased +- group because we wake all futex waiters right after clearing the +- flag. */ +- atomic_fetch_and_relaxed (cond->__data.__g_refs + g, ~(unsigned int) 1); +- futex_wake (cond->__data.__g_refs + g, INT_MAX, private); +- } +-} +- + /* Clean-up for cancellation of waiters waiting for normal signals. We cancel + our registration as a waiter, confirm we have woken up, and re-acquire the + mutex. */ +@@ -171,8 +154,6 @@ __condvar_cleanup_waiting (void *arg) + pthread_cond_t *cond = cbuffer->cond; + unsigned g = cbuffer->wseq & 1; + +- __condvar_dec_grefs (cond, g, cbuffer->private); +- + __condvar_cancel_waiting (cond, cbuffer->wseq >> 1, g, cbuffer->private); + /* FIXME With the current cancellation implementation, it is possible that + a thread is cancelled after it has returned from a syscall. This could +@@ -327,15 +308,6 @@ __condvar_cleanup_waiting (void *arg) + sufficient because if a waiter can see a sufficiently large value, it could + have also consume a signal in the waiters group. + +- It is essential that the last field in pthread_cond_t is __g_signals[1]: +- The previous condvar used a pointer-sized field in pthread_cond_t, so a +- PTHREAD_COND_INITIALIZER from that condvar implementation might only +- initialize 4 bytes to zero instead of the 8 bytes we need (i.e., 44 bytes +- in total instead of the 48 we need). __g_signals[1] is not accessed before +- the first group switch (G2 starts at index 0), which will set its value to +- zero after a harmless fetch-or whose return value is ignored. This +- effectively completes initialization. +- + + Limitations: + * This condvar isn't designed to allow for more than +@@ -440,21 +412,6 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + if ((int)(signals - lowseq) >= 2) + break; + +- /* No signals available after spinning, so prepare to block. +- We first acquire a group reference and use acquire MO for that so +- that we synchronize with the dummy read-modify-write in +- __condvar_quiesce_and_switch_g1 if we read from that. In turn, +- in this case this will make us see the advancement of __g_signals +- to the upcoming new g1_start that occurs with a concurrent +- attempt to reuse the group's slot. +- We use acquire MO for the __g_signals check to make the +- __g1_start check work (see spinning above). +- Note that the group reference acquisition will not mask the +- release MO when decrementing the reference count because we use +- an atomic read-modify-write operation and thus extend the release +- sequence. */ +- atomic_fetch_add_acquire (cond->__data.__g_refs + g, 2); +- + // Now block. + struct _pthread_cleanup_buffer buffer; + struct _condvar_cleanup_buffer cbuffer; +@@ -471,18 +428,11 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + + if (__glibc_unlikely (err == ETIMEDOUT || err == EOVERFLOW)) + { +- __condvar_dec_grefs (cond, g, private); +- /* If we timed out, we effectively cancel waiting. Note that +- we have decremented __g_refs before cancellation, so that a +- deadlock between waiting for quiescence of our group in +- __condvar_quiesce_and_switch_g1 and us trying to acquire +- the lock during cancellation is not possible. */ ++ /* If we timed out, we effectively cancel waiting. */ + __condvar_cancel_waiting (cond, seq, g, private); + result = err; + goto done; + } +- else +- __condvar_dec_grefs (cond, g, private); + + /* Reload signals. See above for MO. */ + signals = atomic_load_acquire (cond->__data.__g_signals + g); +diff --git a/nptl/tst-cond22.c b/nptl/tst-cond22.c +index 1336e9c7..bdcb45c5 100644 +--- a/nptl/tst-cond22.c ++++ b/nptl/tst-cond22.c +@@ -106,13 +106,13 @@ do_test (void) + status = 1; + } + +- printf ("cond = { 0x%x:%x, 0x%x:%x, %u/%u/%u, %u/%u/%u, %u, %u }\n", ++ printf ("cond = { 0x%x:%x, 0x%x:%x, %u/%u, %u/%u, %u, %u }\n", + c.__data.__wseq.__value32.__high, + c.__data.__wseq.__value32.__low, + c.__data.__g1_start.__value32.__high, + c.__data.__g1_start.__value32.__low, +- c.__data.__g_signals[0], c.__data.__g_refs[0], c.__data.__g_size[0], +- c.__data.__g_signals[1], c.__data.__g_refs[1], c.__data.__g_size[1], ++ c.__data.__g_signals[0], c.__data.__g_size[0], ++ c.__data.__g_signals[1], c.__data.__g_size[1], + c.__data.__g1_orig_size, c.__data.__wrefs); + + if (pthread_create (&th, NULL, tf, (void *) 1l) != 0) +@@ -152,13 +152,13 @@ do_test (void) + status = 1; + } + +- printf ("cond = { 0x%x:%x, 0x%x:%x, %u/%u/%u, %u/%u/%u, %u, %u }\n", ++ printf ("cond = { 0x%x:%x, 0x%x:%x, %u/%u, %u/%u, %u, %u }\n", + c.__data.__wseq.__value32.__high, + c.__data.__wseq.__value32.__low, + c.__data.__g1_start.__value32.__high, + c.__data.__g1_start.__value32.__low, +- c.__data.__g_signals[0], c.__data.__g_refs[0], c.__data.__g_size[0], +- c.__data.__g_signals[1], c.__data.__g_refs[1], c.__data.__g_size[1], ++ c.__data.__g_signals[0], c.__data.__g_size[0], ++ c.__data.__g_signals[1], c.__data.__g_size[1], + c.__data.__g1_orig_size, c.__data.__wrefs); + + return status; +diff --git a/sysdeps/nptl/bits/thread-shared-types.h b/sysdeps/nptl/bits/thread-shared-types.h +index 5653507e..6f17afa4 100644 +--- a/sysdeps/nptl/bits/thread-shared-types.h ++++ b/sysdeps/nptl/bits/thread-shared-types.h +@@ -95,8 +95,7 @@ struct __pthread_cond_s + { + __atomic_wide_counter __wseq; + __atomic_wide_counter __g1_start; +- unsigned int __g_refs[2] __LOCK_ALIGNMENT; +- unsigned int __g_size[2]; ++ unsigned int __g_size[2] __LOCK_ALIGNMENT; + unsigned int __g1_orig_size; + unsigned int __wrefs; + unsigned int __g_signals[2]; +diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h +index dedad4ec..bbb36540 100644 +--- a/sysdeps/nptl/pthread.h ++++ b/sysdeps/nptl/pthread.h +@@ -152,7 +152,7 @@ enum + + + /* Conditional variable handling. */ +-#define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, {0, 0}, 0, 0, {0, 0} } } ++#define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, 0, 0, {0, 0} } } + + + /* Cleanup buffers */ +-- +2.49.0 + diff --git a/meta/recipes-core/glibc/glibc_2.35.bb b/meta/recipes-core/glibc/glibc_2.35.bb index f9086c0855..e744260e87 100644 --- a/meta/recipes-core/glibc/glibc_2.35.bb +++ b/meta/recipes-core/glibc/glibc_2.35.bb @@ -66,6 +66,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ file://0026-PR25847-2.patch \ file://0026-PR25847-3.patch \ file://0026-PR25847-4.patch \ + file://0026-PR25847-5.patch \ \ file://0001-Revert-Linux-Implement-a-useful-version-of-_startup_.patch \ file://0002-get_nscd_addresses-Fix-subscript-typos-BZ-29605.patch \ From patchwork Tue Oct 14 14:43:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kumar Dora X-Patchwork-Id: 72263 X-Patchwork-Delegate: steve@sakoman.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3579CCD196 for ; Tue, 14 Oct 2025 14:44:50 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.web11.18523.1760453084873491981 for ; Tue, 14 Oct 2025 07:44:44 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=qI7+B2jY; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=2382047737=sunilkumar.dora@windriver.com) Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 59EAhUfv3483883 for ; Tue, 14 Oct 2025 07:44:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=KBcVIIMxZFND81YAXPnH5Sw26cLsW12NVFKkENcfT0E=; b= qI7+B2jYBY2eCoTjlaQ70I8+Y4VmYiOKAnXdnJGDNY3ftyTueg2RgMDvNdtccvX6 nOrjGsfAVD6lxcjUla5LlR0p/rgowNPynbRXa6gRuH5exkcGsV6P0ruH06luQOHH mDr7mxN6ZS+UGFNbawYtsl34ygFpkiavglxWRgnWZVn2deEoRm+xvtScAruJFfxh PM+M1b+0Qc+lhS7IDQum3GR+TOgUIywsuNNB+KW1vlE99Zj0SNKhV6Le6qbLsVjL SURKCoikKKzdxTpH7/lKRLBuLaHXE0C8Eyrm2pRnqN3OAGY4qpIuG5cXXxY975tT OXvgcHN9SwXCPvyP3Q5AQg== Received: from dm5pr21cu001.outbound.protection.outlook.com (mail-centralusazon11011054.outbound.protection.outlook.com [52.101.62.54]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 49qjh1k3wa-5 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Tue, 14 Oct 2025 07:44:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DuSR9hK2tz4VdhdaD1s4nBhk29PR6es3x5ylZkJrksWW6lpQcIQqNAqS4C2kQG74FlRY/dRGwihS5kWHkX7o/3JrrF8yqXRFARp4iaS04tTsm2CtV5YA2pKh01a+tkwCGPM+94NxImnaSb4WuJ9nq3j/s2lKp0wYY8jXWorauXNjz5+pJi3XS/xNkDPDwAx/jgVpHMzBxuiWaKRmv5RBpOoWr1deTC4px0sMFrhDiN5tsulPcyHMNfXkK0SoeS2yYuDrYyMWb1zzyPgkhCOlZAnbbVW5lp0wgfih8JOo6yf9U3wA+Hec0f4DtK+OvxUJSHWfDvHTyJumnENSl/XHRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KBcVIIMxZFND81YAXPnH5Sw26cLsW12NVFKkENcfT0E=; b=s5y341GcKpsBezb52MOFtEteWT8Ez1qHyOrn3hfEag4GxHlCGnU9MqHyvVoq1NpQXZK46MGcPjVIpiVWe0NCpQzqbB6q+iRYLueJDQhOj4cELcroqnIxPf3NiGjGzClZjaZ6Fll46OINjHcvZnc2bMzwm592rV37WUQ1c5OaNj10XSW4E7jT/10wnTQoy4C3bxwwe0c/7+M+MSpn/GwKWc47A1/KJ+MFM0oMkyIb/1mXZcKM3ntRUNQumDdHGsKuJ57/jMc6hvI1lBy311rVWl1gqDTLCcJgt0fDQomh4Luxq8tOHJinPQkXLBSQHlXOOU/IyB8mhox5S2g0Y+WmFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from DS0PR11MB7901.namprd11.prod.outlook.com (2603:10b6:8:f4::20) by DM4PR11MB6381.namprd11.prod.outlook.com (2603:10b6:8:bd::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9228.10; Tue, 14 Oct 2025 14:44:38 +0000 Received: from DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::9fa:eb3f:cf26:264d]) by DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::9fa:eb3f:cf26:264d%3]) with mapi id 15.20.9203.009; Tue, 14 Oct 2025 14:44:38 +0000 From: sunilkumar.dora@windriver.com To: openembedded-core@lists.openembedded.org Cc: Sundeep.Kokkonda@windriver.com, sunilkumar.dora@windriver.com Subject: [kirkstone][PATCH 07/11] glibc: nptl Use a single loop in pthread_cond_wait instaed of a nested loop Date: Tue, 14 Oct 2025 07:43:43 -0700 Message-ID: <20251014144347.536537-8-sunilkumar.dora@windriver.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251014144347.536537-1-sunilkumar.dora@windriver.com> References: <20251014144347.536537-1-sunilkumar.dora@windriver.com> X-ClientProxiedBy: SJ0PR03CA0279.namprd03.prod.outlook.com (2603:10b6:a03:39e::14) To CH3PR11MB7896.namprd11.prod.outlook.com (2603:10b6:610:131::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7901:EE_|DM4PR11MB6381:EE_ X-MS-Office365-Filtering-Correlation-Id: 7bb9f2d9-16cd-412d-f0d9-08de0b303365 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|52116014|38350700014|13003099007; X-Microsoft-Antispam-Message-Info: necfITas9HYY4/nUgGjB6e7R3+Zark/euU43D9BNikZcV/36s0ILFOykm/in9sLYHP02TGze+awzsI89dh7unwPnw+i/h6VZGnvv7mYLof88aX9qTPq0po0p7s8m+meL30fnAQw+y+TZAqc3Jb1gfkMd5++KtEausiwNNwfUD4FElZGU/bQ5R+psPqr0sZB7vpeQc/FvTHxMmKz9rpQz74Va1pFc62HajYy2W9YTX7mbgcGF/KjFR9D6wySahIDlVtJv9ndeOp4zQ/qliE7PTU5RuwmgPfjDL69z7nk/whLN0FQItEEE/riEPjdO1kNYkjJuIOeEUYlYdG8XGWRp5MtA3dLQkpoyJuefDkZMKF+QHOMJ/I460CGvbV4RkP12ZPIQnk6L/t6S3mJxgDxZqE8XRI3MMfaV+qXlCZ4Uo4YpzcWpjFQjV2P6ZvMedsdYK/dG0ZE3DQM4hpcw/Sc7c+G8A+6a6mrIPMprp2XzvoOUk9TGwX1Xm7V0b2H/G0aoS6jLrlqR4UqidHvMVUUWUwwJtxGHYZhjxlOcHdPPF4oFxRWnikvQRsakc3t2/nJIwIeGu7hhCqM+X7LFKWW+MNG5nJv6nButXioj2yawTkYpdwOwRKj2CBiuyT9QF7TIwMV6S08D9HkR4tl/dUSzEcoGes5mMrsHo33R5TYl/P0cy6GsqPmqzBgvZr4suQMddDEKhdQc30AsqbSTuzB3LV0BFrBDEQ1Fpcn6R7DsU9KMhkRvXJD9RCuvqq9T/G+Z630xgOXEFfcLfu5ddIVDTUZ0dSpCvyK2i1GPgUuy24fx+sEK5cfAZxNo+xTkBPsWg/F1cXEjqsHY8e8vJkO+EMrZ+lQAM7JrTnEeq39uouEIrphXiEVtnPId3QRXOv1adUUSUABE6wYFxVfZtx9mSnWSGM0WXcscwCmP9sv8VeBT8itxCJnZVfNLR7e71fxjv1CONOTP1bQSZ9ZiZD4sFp/xiyNYsHuimd5ylYAYFbqE3dH6DSKQCHYfsUfwcIRqJ/YeZKXnAIxaURaf0tjIvx9M4tC/xjm6QihlajI9B2bjN9RwJv4yJJQZvfQlFRnwg+/KPShMJyvYaNYPyrpzbSaU491RamLyXKAT1qm4umlf/JePST0xM7WK2Oqt45G0GNnP1qiBmA73FK3+DzGhG7hbgCd5W/y2+rXDTELQRGhKP8uOpDEXNLDWhzPhjtPAGCeTE1lUUOV2zQLHVw2SO2//OtCtbCIOHptL5m99ZMaLZ7S5zLeyDnYJgA3MPcvmJLxbeKKfgToeT+QXBseI7/4YUp/jhBuzKUj+P9VtziIK2xwRILWKAe6C+6TpMTbMNUNswBGKYFOqErOvT/1vA0pbzTO5OMtyCiY8fFOeW5RXvEKv+/ecpD3mo6FmQ4o/wu6JWX7NXwAgXaigLFDVAMGnzfd8WzI0zfepvKAngSJgntQmR70oX6wdkXI8l7clxTmL7+HbTnFbwhOJJCMvJA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB7901.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016)(52116014)(38350700014)(13003099007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uXR7bmraqrNMzqnQBUxdNhLOJ4mYrSKqdiNaw1bpstfQTH/e05+h1ItVW3YWcDX6b+ikalNmwGuhRdXIos1Xly5+FTk9YSyxI96zzBYKmkh6cxHlSeshYmCp6cSt/UifVJivBgpIDtoK13OilC0V3g1MdGtc481/tWJYtUn+dBGTn/2TKetNZGM5/de9ru5mS17MNksNDeETvsSBPOPHPP/JX8m+bQcqzBdw4/muaFOnfMCXtbSujwPayU+7Z61BexWiKjNkwln2/+b/rtC14q2ogSdSkRLAcDsuIRDDFbXL1Y25tpvSXBkDLrPLTOhbqPOWi3+zrEm5HXz+9uifFEpMqvM94xfhjNN6gobOlVlzs5hzfn5hDFXV9YPBEpratmLeTt46rguCH9/B0R7nTRRLMvh/o2KdORmpVHGPvOeM+1o1BAumAhfKlCJGhwyT+T4T6R5yILyDxl7MjSK8YJHmkdygRjcYR6hXY5EKmM9iZgc2OwYgrZnfE+IhWsUPEkMj+Nb0va+FA7yOyhhLGGQC75PXJvXTcjOM7USjcAVzH4A4pQ3W1/sozCnXnf81CjvGpUdJzGsQnOpIWUaPBIM52Ep/GH3qnfKAaKXbde/Mav0L54anq4dJxMNxYsg9rptTj5TsGis1gwtewthlI91kCLH4GT8NXkgzaipO0xyR65MfuIrK3DKp0x8VrQ4a1llwLUASSGtxGtWyxsrqwtCfBJHMErDH9PVDo/RZUxY3Oe4o6RGmX0nakG+pOmwyjSlrf/CGeP6FbCVT84Z4mfe79yl+8YOtqIRddYkkbIB6N3Y0TNuyOAx7ay6bKEAnAoFJGlyfCXSp9tuueeE3LIdVHrrCsT8ceCLNSUIBosH0rVBa4fhZh0jX6K4+FBl32JQiXGXWxe1er8SlMwf96x3ZJ1Nei3aqnOu7XxOlRKNyGY/mIEIr5QkshbC26aNIGbB8hmkEoDHjKFEnDPIp0qFUDUlauvZhUNkPcavr28BQtxcVpsm0S8d8HZO2dFk3an0Vg3Ue/E0ret4tIj73hbu1rZDAUER0td2alcGawCx+gO1ip+szewvmUcyo3TahPnaCTKykb+c1bKG8x+XjGr5m2aU4MrrfTYnOo8MaCZoVhcjoZRREZwBIiVmyw65Y9y/OkvulfB9sedxbZxcjM0SmXYUbUqqAxJtX9HQ8iOwtlu51tbdMUlLQbhSHSgX9jcxhI6+73UB9tgqV5GY0nPIBVdTNIBtD0E3CmPQywAX1Pt/6RAmt3FUunfv6UOkpD9DH8eOGFwtOfuwBvTut8weRE2ijQZuNrrQ4qTtfLgboI6HKY5J8lFu+4zbcKz9LUPhRCpaMNr+wqJv9l/ruEyWO8adjAyQlOCQjHlKRLTqXU9o0CZZw7nCNJtl/YE7CHr/wGwmi7NBORj0k/hIvqc/VsMR7Sw+OsUcGkTcrMBAmLxF19XzJzgD6RF23pSMD5474Vx4pDnFCk36oHWgyRXxu2VmzuGOiMHuQDPQp71IXV2ZaWT4X8Fd7OFGrWjXia+fdrkkdGKpPNLpgf9HgmxowD2bT1IYNSrmb8JbT+LIuAJygZgbQZ5GYCysDMSN7wo6stitSfleJ5lMZMEDCh6kW+kVlbvGyxvPRDSaCvbE= X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7bb9f2d9-16cd-412d-f0d9-08de0b303365 X-MS-Exchange-CrossTenant-AuthSource: CH3PR11MB7896.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2025 14:44:38.6159 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2LUlF27Yn5+vvtBYFT26BeFEcWbEUCQwAHc+7FfH37Sr9T0mpcibdsecZpCPBXoX1wzrONDbkDGk/h/t7bpj7DBZujmD5W+zOmpfIRTvb8s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB6381 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDE0MDExMSBTYWx0ZWRfXwbd8v5U6My4E tqQYQHG3arRtYLM7UO5h9AjHZGoOun2Nq4wWnlhF8VjqOvbPeMtVjrEG4X0nQhlINXzoZfsr0d3 RIqQ/vqqlIUYwm7ijSdGI5EiQ1o34ZU+8RGH4NnsJD18/qZq/eRQc82griZloXV55XtUVPRljtX QaRXL9DtB/w5Q8RQO9lyE2uUd7VvJLTFZ7O56uQ4lpgFBBpz4C1JlRfo1Q4DbCfzGTWEgobPTGj WQLU+uh959kSCGL0cztSOkZY6h2HQYdH1DRzOYsdr6AFaWLkG5cZYxJtGmxGR0K5hlIwz9DUPo3 2+H6SnwzBUPTQiw0qonnTLO/CmJHawu9qFEjcHiKwwBY3tuzs3kEs0phEb3kaA2X5Pi2pPFgx8K qf9S8D/QI0U/cEDSmrVJZYsH0YTlLg== X-Proofpoint-GUID: GiiwToSOKKNtQFBvExp5lb42H6emdqLQ X-Proofpoint-ORIG-GUID: GiiwToSOKKNtQFBvExp5lb42H6emdqLQ X-Authority-Analysis: v=2.4 cv=aetsXBot c=1 sm=1 tr=0 ts=68ee61dc cx=c_pps a=7v6vjeP3yXOm/Y6ajRpg3w==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=CCpqsmhAAAAA:8 a=t7CeM3EgAAAA:8 a=C2QAroOMQ5yFKVvllzUA:9 a=iT_T7jMFN14A:10 a=ul9cdbp4aOFLsgKbc677:22 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-14_03,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 suspectscore=0 phishscore=0 malwarescore=0 clxscore=1015 impostorscore=0 bulkscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510020000 definitions=main-2510140111 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 14 Oct 2025 14:44:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224827 From: Sunil Dora The following commits have been cherry-picked from Glibc master branch: Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=929a4764ac90382616b6a21f099192b2475da674 [2] https://sourceware.org/pipermail/libc-stable/2025-July/002279.html Signed-off-by: Sunil Dora --- .../glibc/glibc/0026-PR25847-6.patch | 103 ++++++++++++++++++ meta/recipes-core/glibc/glibc_2.35.bb | 1 + 2 files changed, 104 insertions(+) create mode 100644 meta/recipes-core/glibc/glibc/0026-PR25847-6.patch diff --git a/meta/recipes-core/glibc/glibc/0026-PR25847-6.patch b/meta/recipes-core/glibc/glibc/0026-PR25847-6.patch new file mode 100644 index 0000000000..7d5c4fda5f --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0026-PR25847-6.patch @@ -0,0 +1,103 @@ +From bbd7c84a1a14bf93bf1e5976d8a1540aabbf901b Mon Sep 17 00:00:00 2001 +From: Malte Skarupke +Date: Tue, 14 Oct 2025 06:19:02 -0700 +Subject: [PATCH] nptl: Use a single loop in pthread_cond_wait instaed of a + nested loop + +The loop was a little more complicated than necessary. There was only one +break statement out of the inner loop, and the outer loop was nearly empty. +So just remove the outer loop, moving its code to the one break statement in +the inner loop. This allows us to replace all gotos with break statements. + +The following commits have been cherry-picked from Glibc master branch: +Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 +commit: 929a4764ac90382616b6a21f099192b2475da674 + +Upstream-Status: Submitted +[https://sourceware.org/pipermail/libc-stable/2025-July/002279.html] + +Signed-off-by: Sunil Dora +--- + nptl/pthread_cond_wait.c | 41 +++++++++++++++++++--------------------- + 1 file changed, 19 insertions(+), 22 deletions(-) + +diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c +index 8a9219e0..c8c99bbf 100644 +--- a/nptl/pthread_cond_wait.c ++++ b/nptl/pthread_cond_wait.c +@@ -382,17 +382,15 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + return err; + } + +- /* Now wait until a signal is available in our group or it is closed. +- Acquire MO so that if we observe (signals == lowseq) after group +- switching in __condvar_quiesce_and_switch_g1, we synchronize with that +- store and will see the prior update of __g1_start done while switching +- groups too. */ +- unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g); +- +- do +- { ++ + while (1) + { ++ /* Now wait until a signal is available in our group or it is closed. ++ Acquire MO so that if we observe (signals == lowseq) after group ++ switching in __condvar_quiesce_and_switch_g1, we synchronize with that ++ store and will see the prior update of __g1_start done while switching ++ groups too. */ ++ unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g); + uint64_t g1_start = __condvar_load_g1_start_relaxed (cond); + unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; + +@@ -401,7 +399,7 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + /* If the group is closed already, + then this waiter originally had enough extra signals to + consume, up until the time its group was closed. */ +- goto done; ++ break; + } + + /* If there is an available signal, don't block. +@@ -410,7 +408,16 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + G2, but in either case we're allowed to consume the available + signal and should not block anymore. */ + if ((int)(signals - lowseq) >= 2) +- break; ++ { ++ /* Try to grab a signal. See above for MO. (if we do another loop ++ iteration we need to see the correct value of g1_start) */ ++ if (atomic_compare_exchange_weak_acquire ( ++ cond->__data.__g_signals + g, ++ &signals, signals - 2)) ++ break; ++ else ++ continue; ++ } + + // Now block. + struct _pthread_cleanup_buffer buffer; +@@ -431,19 +438,9 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + /* If we timed out, we effectively cancel waiting. */ + __condvar_cancel_waiting (cond, seq, g, private); + result = err; +- goto done; ++ break; + } +- +- /* Reload signals. See above for MO. */ +- signals = atomic_load_acquire (cond->__data.__g_signals + g); + } +- } +- /* Try to grab a signal. See above for MO. (if we do another loop +- iteration we need to see the correct value of g1_start) */ +- while (!atomic_compare_exchange_weak_acquire (cond->__data.__g_signals + g, +- &signals, signals - 2)); +- +- done: + + /* Confirm that we have been woken. We do that before acquiring the mutex + to allow for execution of pthread_cond_destroy while having acquired the +-- +2.49.0 + diff --git a/meta/recipes-core/glibc/glibc_2.35.bb b/meta/recipes-core/glibc/glibc_2.35.bb index e744260e87..3034461e9e 100644 --- a/meta/recipes-core/glibc/glibc_2.35.bb +++ b/meta/recipes-core/glibc/glibc_2.35.bb @@ -67,6 +67,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ file://0026-PR25847-3.patch \ file://0026-PR25847-4.patch \ file://0026-PR25847-5.patch \ + file://0026-PR25847-6.patch \ \ file://0001-Revert-Linux-Implement-a-useful-version-of-_startup_.patch \ file://0002-get_nscd_addresses-Fix-subscript-typos-BZ-29605.patch \ From patchwork Tue Oct 14 14:43:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kumar Dora X-Patchwork-Id: 72262 X-Patchwork-Delegate: steve@sakoman.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BE5ACCD194 for ; Tue, 14 Oct 2025 14:44:50 +0000 (UTC) Received: from mx0b-0064b401.pphosted.com (mx0b-0064b401.pphosted.com [205.220.178.238]) by mx.groups.io with SMTP id smtpd.web10.18465.1760453086323264902 for ; Tue, 14 Oct 2025 07:44:46 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=YlUDCtf+; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.178.238, mailfrom: prvs=2382047737=sunilkumar.dora@windriver.com) Received: from pps.filterd (m0250811.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 59E5j2j83734593 for ; Tue, 14 Oct 2025 14:44:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=LZ3zH80OPA0Q/JJg2Bur+ic+9pqU3CqC7otxFXjfsOU=; b= YlUDCtf+k46WU6f9Jyi6ffscTQTRpQEFaRfq/leS57bCT8EoRLwzO1GIfuzB5NEg Du+XhPK8gjmhuW2lmRcsj4idj3IRTKS8veZJBwvXzOb6iVDQlz2hCweOAPlZBnCt 7MzElpEEA9Io/mv/g6PAPkhHlmpJw5vqPghiNg9iXwyZdXjLgRWw6lHsPa+sX7re d6v40V6UlodGTDTl+OakUPSzRCn449G+IaZiQ6kEozHMeA0RWKpYhs+LCDNFalyY DD1+IK4Gr+troXndwXZkX8BRwTwuXooR55kFBlQzBCaHzpbR8HweTOVgGcSB11hU d49paKurb1ziWkKi9cp8fw== Received: from ch5pr02cu005.outbound.protection.outlook.com (mail-northcentralusazon11012040.outbound.protection.outlook.com [40.107.200.40]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 49qcewkb3y-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Tue, 14 Oct 2025 14:44:45 +0000 (GMT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=A0txyakQmPRxSwMsC1yhTIwyWM74r3D/uwfOL/f9kHoIxn0SDBTrFFbjlxK5trLXusgFnCaX4/Ett5Rmd5S6uRj3xNzmC03XFrwZoE7OCvTM7dBwKfSg9NChTwgOUPx4kORndR2igks3as9lPR6l0U6Vk4drNhqCzRrJX7LunKQzHvE8wuTwsoAEdU7ruWHIxpgrdzTlnwA0akS4WzNF+lg0M34xN/wzCSX+CsNKZwEF8Y8xiGGSNhLcF4S8ovl67m/N3DZ50+W/65VgMvN4qAgYC4CPXF18Wn0C2FGMBzm9p4Q+5Fbe5IIfh2AoB274hG0Kv64ScgswDp0PmTGUog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LZ3zH80OPA0Q/JJg2Bur+ic+9pqU3CqC7otxFXjfsOU=; b=Es/9cD9r3OHjZir1akDTjZgu8gP3gztJzLvRJUtseHjy5fFx8zhk8ujCynS6+ma0SeTms5tIUz6MDPuoob3PmWNvbbtx0JWlEH/fPufaXxUjImWgTd3LTvPo2evWTIYf+qW7Csg8hdWzEMy2eaWCVTqgcuxjINFuyUq2dDSb7dzI5UmjTIVDY+NLUXJYk2xlq4i+HJZjeBYJEoBrdEPQKLuXJo9QE0HmLb/JOYAuRReMJVyn4j60BZjydb94lPiInwWrbAQqHTyAByRTFCgzTT9P7PBltqHjkMLpLE953NSCA8VBJeTZ/NvS0LafnetLXMw9UI2LNsm/DFvqPwlLAg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from DS0PR11MB7901.namprd11.prod.outlook.com (2603:10b6:8:f4::20) by SJ2PR11MB8538.namprd11.prod.outlook.com (2603:10b6:a03:578::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9228.9; Tue, 14 Oct 2025 14:44:42 +0000 Received: from DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::9fa:eb3f:cf26:264d]) by DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::9fa:eb3f:cf26:264d%3]) with mapi id 15.20.9203.009; Tue, 14 Oct 2025 14:44:42 +0000 From: sunilkumar.dora@windriver.com To: openembedded-core@lists.openembedded.org Cc: Sundeep.Kokkonda@windriver.com, sunilkumar.dora@windriver.com Subject: [kirkstone][PATCH 08/11] glibc: nptl Fix indentation Date: Tue, 14 Oct 2025 07:43:44 -0700 Message-ID: <20251014144347.536537-9-sunilkumar.dora@windriver.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251014144347.536537-1-sunilkumar.dora@windriver.com> References: <20251014144347.536537-1-sunilkumar.dora@windriver.com> X-ClientProxiedBy: SJ0PR03CA0279.namprd03.prod.outlook.com (2603:10b6:a03:39e::14) To CH3PR11MB7896.namprd11.prod.outlook.com (2603:10b6:610:131::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7901:EE_|SJ2PR11MB8538:EE_ X-MS-Office365-Filtering-Correlation-Id: 84bc6653-ee89-48a1-e058-08de0b3035af X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|366016|1800799024|13003099007|38350700014; X-Microsoft-Antispam-Message-Info: 6XWiuiUQDaemRKFWx/7KU0Ou9+FSk2yc0ExqtaQsCu71mSDRdu1zIIjPSQcxaq8RjYSPVjjq4e86VFPq+MD5ukQKomHnF4mC1mNR6vm/FkFBYJc/po3ivo1nGeu6fV3HA90ggSmbb0ZLfcrAthfPuVaJrT8DNBIytUhfed9GdILy1VArRiMN5yXbSZSF0YkKW4b+JCCgALiiod6sNZzq9ar/wTiOW37F9thfdFcXv769m0V86zvjAHCjzbmZqcy3cWieT6MDHweXg6dMVoaTyxa3wYAtSyyNGU5etYPiO375R5pJOReXsFvZjdpo2yUPW8hcX3aZsF2YPH5Elr/yVp0VvwZ5gTW39R4zVeBUYFggZgNx21AZSIq5pGV+UTtZJWc9kO6TwidrYmyx8mKj2e0/9AlUBlO5vwek7kSR29lOxPiIb2hC9Ik8t/uPS7hM6L/+79Ao9UotMudzyH2XhJoA1Q1uzdrQk+WvAchn54IPNquKM+SNo5pp/GDdJsaFhCT6w99Ks6AfMx7/9ZSrd4vF0GekV/eDbXRzqZj+hKaUp9jM/sz6PemeXMJSJ5TF+pY0txPogK2UCWm8PGv4PHVmwrmGeHl571peTlkpQ5S/D7Anu4abowK/fq8yUVLDsHVUAtNBS/xNHCBJM7gb3Fz4D7BIDLBZ3oIUhQHsIrwUBnqwOUy1Y1JHf08St6KJvRAb0rwm+PESbUyC3kOCuRs7ik0wcKWgG7y+vQJiSVuISVUOxNSn80xD1MfNRZmrbEqau36hCFQ1ZEpl0ypwjsjFYJbxSwae5ynpKWwPM30mKNu9UcoPoWVCG8+Wy7GKw2d92Q19/KK9ZH2bEVy1XVEN/hp6dXSBlEtgR7Zv67K6g9npzcBi0csMXFKo+q7CCJrAW761soLpEefGQ77dPLnv6AZ+rgpX0z5cP6610c2PCIhPYYzSr3JzvwFlc7+v1RQ6W5eOoh7ddc6P7gHAXz7ko6jZTRnWv4MTSfI2ASjqdgULKCNZVuEfqhiDWW8IOb4ULVw/8oyu82rycQ+rzRuGB5xxZWL2BcbppNU7a5A8FnfAhcly7OYIln6JEIk72aqY6FX7/18d/YCVe0ReIDPg9jDc+8VytqKwDDXn/OJIWDf09S0Jbruh4rgvl9UHPJ+OCtsLIIHKoX34vpBoERwqdVbt1edVuSdPiB7v1xcxz0yWl8hnS4sE9uNfuH5ai8stO5eTkXMG7xyLUcgMciY2sgPd2Qp/dkWf3XmedUgqe/8XVsxL3Wbh5ONEr1acp7oJi5K6CkrrUZPjBH/dSFIWwetAfUoWGycp2A3iDLs44n0EEvtgy60YfvyvaYYDAguMo5nKmb6yZdTf+FM5CnP6SgtEeqLqNXdUlsprqesq/83mFPbDI8P6vDvuy8AALFzPj1hviwpoTFulSw2h013q/MawyZdmjmy+KDG1mH7+juX//ICkVsDABD6A2PUyqOE98tvDtBNhNvsKOCWhWg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB7901.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(366016)(1800799024)(13003099007)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: o22BhOZfJY17e7hGFu4lQb7J8r0kVsmzc8ALhn9un4sCYcW3kTIrIkOu366GkY8JP41jXXbmN2/9r1V7USjI8uCzvPvmiLAHL1uYP7vFDhn5DY4G6E+Bj/Gj9wixHkLQv7xwJKI6cR9HqFbbx46hs0yDGIERbhz/6QBbCUR5YQRzi7yGx6RHAzT/XC3AHxFuEmt1qYVX3BZ9CuLM1YYWGiocl+HzE7jAH1Cnw5g48FGzEzsDbK1O77IxNNxC7jJB37QNaDliAg/85RXbzV35uG3XLMZWhUb5bSxTYq9ZPnqY9iOB1MODXXjivE4wL6lh1dcdOuadaDtvb0EA9DnhMRunWTziznHiovyrwbk5SQFQoDXXts4Ou8asjG6i5cMNJXCMqkH0hEc9/KeuVnUv9EgtozkXjGalobIHBzXwkWEgRwQ+1gtLGqsaDGaoFqLKPrEqNWxKSqyKtBwHmZlxiXZZ1iJy4pAMvKxORNJkIwje601n2KU0Ryco1Abw+DwSZ2Ev+TO89TUOcbrh7zLQrINJAY9fMd4zy8n/1ZusW6EBrBaGcg24eUlAG+Aj7U/LKUJNUdbEOZPEpDoniV5KpF45BJ5VmkYnIufBx9U0ot8eHH0/xxXjrNSNI5K00EbblEnZypOakaAzUjTIQID4JRRiv6AvhNTdgAutHbHmESwDC4Z9qr6B2Pp+rABQlm34gIJTMe7YBLDkfI7Bb0g3Bi4IU9g7UFNK0QHcxcOjUEVFx23F7xYPCsFGKJukt/BQlzTbrVwDRHjwq2ohVyy5KN/8ljbUrxD0sYgxN3hZe+s4DOFKjOb9iM5Gl8JZuAkTWuhGhgTdVI+mRQo8nm9pbOz17e/VZ6sHNLdeUxbkVqRwFC9q9iPA4NZXITFk5fJTRBu8ADuw023H76rUuKaek+gTe3eIenScWzGGIscSAeUaSV0GNITzNo/Jdxl26ys54rYY1vnRum6jUo2IOJGwDakkBEUvUhYks99s//PXi7fgHoHkNowlEbzGuok79wB823su1qiyP3Ja9SOGm9QaHPhPCT+zIWZ5vbTJInhEgH5Q3CcH9myTiVWGky/cXF3BBBVFJAgBxgFDRymekOEUXna0pL1wAVZA2JI3EcKbzbJ488urjEiQO9RfZ9m61B06zBs1mch6BfNeSd5pKGjCWoxIGrCxrEdhXafY8fJtlcGqPfXSzMGLoTt2s47tJOwU2DSiHvmlJpDACTuhmO5H13c+mD5SvOX/3KG9ZVVwTVwgfGM0AWWquwyUV1qnqmzIOnDNSgBEDlbLDfTSKRtzv1I054W/uoV6jRCA8Kc3h2bLNpb84K/SUyDIVDgJNajrb7vMl8biW+fLy57N0PUR9nd52jjtfuC4zM7GG+bcGZ2RZeknGWUd3lya8uC373xeMnPCJTtIjFMm0yj05+yE9h/F7OAxRqoyGXVI8aUK3Rj27UDPuyYFOPqc7U7fGMQP/lLuj9MwwgYUjH0a/3Vo/zQK4usoFMpPeP5/aRp2uMthgIxwAlSYeMKbjnT0Es5eyd9rVLbuYeXjgKrXP9jstQvbeWi4gpOWw2udLS4O/d/X9XTsXyccVd/AFaAMmH7aKGWb1AqDEeBRKSS/vaRIMVl6rWTjLJgojCLJSqlkT5Q= X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84bc6653-ee89-48a1-e058-08de0b3035af X-MS-Exchange-CrossTenant-AuthSource: CH3PR11MB7896.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2025 14:44:42.4552 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ET5w24tgpiL1OAtNGGTFz5T0odeNTclrbeeIwdAVXDjBxKBcSruF+liUpv6Lslc0cOPORl4kGug4lP/fOKpyyk4P1UwHvMlmSObyPu1NpLA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR11MB8538 X-Proofpoint-GUID: cnVGEVUd1rm5xA3DfXUnHKZdqCKdTKrH X-Proofpoint-ORIG-GUID: cnVGEVUd1rm5xA3DfXUnHKZdqCKdTKrH X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDE0MDExMSBTYWx0ZWRfX1gVa0daxBRdw X8YaNEqb34W4ath5Rwf5+af7DNRm4/pap4bu+XJzqQW4WDBUBXCDnQxn9DalJ6QA3H04P1mRDu+ gOlt+krUsJjRkiJxxGfBEjmg4sMYQCHI6tJjy7rHTN50Rkx7xr1T89W1I9JG7at5l9uKCK26dni D63P41Ygh9fYnsQFpQweYggC39aZjjahVGgaSfQ1xfBgxi1HAbStiA/oO64wbmTrFMqER70GVfR 3i5sxqgsYDcKtWA00FkOf5XOBmtelZ1HTnSGFbUkLVXQRlk1xHg8CX6tB/5gEuczFLk64wJSNCw ISohrk87Vz0Q6U/Zzggnc8ibrN05xX9gMnpDt9q9Z+DJpaxjHGzQWjVVMyow3pLk50BCjQXHl1n EuD1IUBjH+wia5FBPtnqrE/bxRW4Hg== X-Authority-Analysis: v=2.4 cv=M+xA6iws c=1 sm=1 tr=0 ts=68ee61dd cx=c_pps a=f2s2IY/meXrRFjAxVkB89g==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=CCpqsmhAAAAA:8 a=t7CeM3EgAAAA:8 a=JHpLaZKHCrPJbBCoxHsA:9 a=ttpAJU0XWFsA:10 a=ul9cdbp4aOFLsgKbc677:22 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-14_03,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 suspectscore=0 adultscore=0 phishscore=0 impostorscore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510020000 definitions=main-2510140111 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 14 Oct 2025 14:44:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224828 From: Sunil Dora The following commits have been cherry-picked from Glibc master branch: Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=ee6c14ed59d480720721aaacc5fb03213dc153da [2] https://sourceware.org/pipermail/libc-stable/2025-July/002280.html Signed-off-by: Sunil Dora --- .../glibc/glibc/0026-PR25847-7.patch | 149 ++++++++++++++++++ meta/recipes-core/glibc/glibc_2.35.bb | 1 + 2 files changed, 150 insertions(+) create mode 100644 meta/recipes-core/glibc/glibc/0026-PR25847-7.patch diff --git a/meta/recipes-core/glibc/glibc/0026-PR25847-7.patch b/meta/recipes-core/glibc/glibc/0026-PR25847-7.patch new file mode 100644 index 0000000000..74cb49670b --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0026-PR25847-7.patch @@ -0,0 +1,149 @@ +From 1077953950d1e8864c63222967141c67f51297f8 Mon Sep 17 00:00:00 2001 +From: Malte Skarupke +Date: Tue, 14 Oct 2025 06:27:04 -0700 +Subject: [PATCH] nptl: Fix indentation + +In my previous change I turned a nested loop into a simple loop. I'm doing +the resulting indentation changes in a separate commit to make the diff on +the previous commit easier to review. + +The following commits have been cherry-picked from Glibc master branch: +Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 +commit: ee6c14ed59d480720721aaacc5fb03213dc153da + +Upstream-Status: Submitted +[https://sourceware.org/pipermail/libc-stable/2025-July/002280.html] + +Signed-off-by: Sunil Dora +--- + nptl/pthread_cond_wait.c | 110 +++++++++++++++++++-------------------- + 1 file changed, 55 insertions(+), 55 deletions(-) + +diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c +index c8c99bbf..adf26a80 100644 +--- a/nptl/pthread_cond_wait.c ++++ b/nptl/pthread_cond_wait.c +@@ -383,65 +383,65 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + } + + +- while (1) +- { +- /* Now wait until a signal is available in our group or it is closed. +- Acquire MO so that if we observe (signals == lowseq) after group +- switching in __condvar_quiesce_and_switch_g1, we synchronize with that +- store and will see the prior update of __g1_start done while switching +- groups too. */ +- unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g); +- uint64_t g1_start = __condvar_load_g1_start_relaxed (cond); +- unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; +- +- if (seq < (g1_start >> 1)) +- { +- /* If the group is closed already, +- then this waiter originally had enough extra signals to +- consume, up until the time its group was closed. */ +- break; +- } +- +- /* If there is an available signal, don't block. +- If __g1_start has advanced at all, then we must be in G1 +- by now, perhaps in the process of switching back to an older +- G2, but in either case we're allowed to consume the available +- signal and should not block anymore. */ +- if ((int)(signals - lowseq) >= 2) +- { +- /* Try to grab a signal. See above for MO. (if we do another loop +- iteration we need to see the correct value of g1_start) */ +- if (atomic_compare_exchange_weak_acquire ( +- cond->__data.__g_signals + g, ++ while (1) ++ { ++ /* Now wait until a signal is available in our group or it is closed. ++ Acquire MO so that if we observe (signals == lowseq) after group ++ switching in __condvar_quiesce_and_switch_g1, we synchronize with that ++ store and will see the prior update of __g1_start done while switching ++ groups too. */ ++ unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g); ++ uint64_t g1_start = __condvar_load_g1_start_relaxed (cond); ++ unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; ++ ++ if (seq < (g1_start >> 1)) ++ { ++ /* If the group is closed already, ++ then this waiter originally had enough extra signals to ++ consume, up until the time its group was closed. */ ++ break; ++ } ++ ++ /* If there is an available signal, don't block. ++ If __g1_start has advanced at all, then we must be in G1 ++ by now, perhaps in the process of switching back to an older ++ G2, but in either case we're allowed to consume the available ++ signal and should not block anymore. */ ++ if ((int)(signals - lowseq) >= 2) ++ { ++ /* Try to grab a signal. See above for MO. (if we do another loop ++ iteration we need to see the correct value of g1_start) */ ++ if (atomic_compare_exchange_weak_acquire ( ++ cond->__data.__g_signals + g, + &signals, signals - 2)) +- break; +- else +- continue; +- } +- +- // Now block. +- struct _pthread_cleanup_buffer buffer; +- struct _condvar_cleanup_buffer cbuffer; +- cbuffer.wseq = wseq; +- cbuffer.cond = cond; +- cbuffer.mutex = mutex; +- cbuffer.private = private; +- __pthread_cleanup_push (&buffer, __condvar_cleanup_waiting, &cbuffer); +- +- err = __futex_abstimed_wait_cancelable64 ( +- cond->__data.__g_signals + g, signals, clockid, abstime, private); +- +- __pthread_cleanup_pop (&buffer, 0); +- +- if (__glibc_unlikely (err == ETIMEDOUT || err == EOVERFLOW)) +- { +- /* If we timed out, we effectively cancel waiting. */ +- __condvar_cancel_waiting (cond, seq, g, private); +- result = err; + break; +- } ++ else ++ continue; + } + ++ // Now block. ++ struct _pthread_cleanup_buffer buffer; ++ struct _condvar_cleanup_buffer cbuffer; ++ cbuffer.wseq = wseq; ++ cbuffer.cond = cond; ++ cbuffer.mutex = mutex; ++ cbuffer.private = private; ++ __pthread_cleanup_push (&buffer, __condvar_cleanup_waiting, &cbuffer); ++ ++ err = __futex_abstimed_wait_cancelable64 ( ++ cond->__data.__g_signals + g, signals, clockid, abstime, private); ++ ++ __pthread_cleanup_pop (&buffer, 0); ++ ++ if (__glibc_unlikely (err == ETIMEDOUT || err == EOVERFLOW)) ++ { ++ /* If we timed out, we effectively cancel waiting. */ ++ __condvar_cancel_waiting (cond, seq, g, private); ++ result = err; ++ break; ++ } ++ } ++ + /* Confirm that we have been woken. We do that before acquiring the mutex + to allow for execution of pthread_cond_destroy while having acquired the + mutex. */ +-- +2.49.0 + diff --git a/meta/recipes-core/glibc/glibc_2.35.bb b/meta/recipes-core/glibc/glibc_2.35.bb index 3034461e9e..7ef2c8cb4c 100644 --- a/meta/recipes-core/glibc/glibc_2.35.bb +++ b/meta/recipes-core/glibc/glibc_2.35.bb @@ -68,6 +68,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ file://0026-PR25847-4.patch \ file://0026-PR25847-5.patch \ file://0026-PR25847-6.patch \ + file://0026-PR25847-7.patch \ \ file://0001-Revert-Linux-Implement-a-useful-version-of-_startup_.patch \ file://0002-get_nscd_addresses-Fix-subscript-typos-BZ-29605.patch \ From patchwork Tue Oct 14 14:43:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kumar Dora X-Patchwork-Id: 72273 X-Patchwork-Delegate: steve@sakoman.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05B3ACCD184 for ; Tue, 14 Oct 2025 14:55:51 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.web11.18818.1760453750256711047 for ; Tue, 14 Oct 2025 07:55:50 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=gKHvIO+V; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=2382047737=sunilkumar.dora@windriver.com) Received: from pps.filterd (m0250809.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 59EBJX9L2621474 for ; Tue, 14 Oct 2025 07:55:50 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=/fxc7bo42BBhnVJN696jJxsJD1p41EJuerJxqsoZuZc=; b= gKHvIO+VO9z/bpkAJfdZd+mt3wV7tQ37GI/ME5QxOUX2dPySMeHvaXlI2n7FvSdq 0rVRC5qQFm5iIz/3rRw7Wpw+8U93TKsieX7v1Emsu6YEqRGrZXESkj33H+At4KOu 4EfkY7nYrAwfAICO03+dYXEcOeMdx4q8uITfdnJ2daeYqDzNXp33+3Toqh6f+QWD /DkFNoJr8G+BI7UC1w0k3+LzeFDXVKMuYnH79olXkeC/mXvznsKLEfFef43pbPbI P+qJn58t/o0xCb4BQArto5eH2/fFRRsUQBNiCfu29waEgKG+L+u6y5RrX5pHqpT7 twyaI/vTVBPg10MvucP0HA== Received: from bn1pr04cu002.outbound.protection.outlook.com (mail-eastus2azon11010024.outbound.protection.outlook.com [52.101.56.24]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 49qprdtyhh-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Tue, 14 Oct 2025 07:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=D/TJsiDlhZnsR58tAik5EmcK2NoASQMazcunfnViE/gDNdy8HIHxL96vh/tkcuDwA48oH1gBnuMi02wm004FhkJ8AcHjqM9jmXc1yqh7NKS+lT1aGJAgqqIWiE5ukSrQtC7HPlQjiHq7B7FJy5rdYKM8hGKmJUivUBIlyE/00Ou9yTdZh6ESK0u61J5MqdOHY/Jh6+U6FBCjYsQDHF+ARBGvLfM8yyncaF3ipY1DlOw3pqJjG2/vSTWA+j7KoST0xbbQP7Wj6si2kvHN3mESax873JEaUGOFucWcDdCflOgaviurCoNMVhtWrRRK46r+67BoNEeoSpYE7UJEvdYJ1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/fxc7bo42BBhnVJN696jJxsJD1p41EJuerJxqsoZuZc=; b=ub7ntwSehzs+z9kHJUnpuE0Tir7KHM6oXcSNlujw3yr+OBmlVr7lEKItX1cGw801YTwZHhor595fkR1tF5aW/r3RSMoIH6E6x7LMGmefoaz1otazDMUfe8LnsZVQiKZrEsdZPuIGu0BpJLKXXpkzHWC0Hj9bD2I/V38x6SedIyRfEF4osOuOT/niHbMxmJ9akCtBU24v26JLIdg8xvYK8dT1VylKiyhXnhO/keijqIVs4bFDH1Gn83Pm+CblpIafYIC9xk8dnr/aDoIiDx7vJseWgu5RpLh82S4C+29OXNwtNKgU10yTofG7jbDZDzz4s5/54Es+ITDGQus9e/8ORw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from DS0PR11MB7901.namprd11.prod.outlook.com (2603:10b6:8:f4::20) by SJ2PR11MB8538.namprd11.prod.outlook.com (2603:10b6:a03:578::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9228.9; Tue, 14 Oct 2025 14:44:45 +0000 Received: from DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::9fa:eb3f:cf26:264d]) by DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::9fa:eb3f:cf26:264d%3]) with mapi id 15.20.9203.009; Tue, 14 Oct 2025 14:44:45 +0000 From: sunilkumar.dora@windriver.com To: openembedded-core@lists.openembedded.org Cc: Sundeep.Kokkonda@windriver.com, sunilkumar.dora@windriver.com Subject: [kirkstone][PATCH 09/11] glibc: nptl rename __condvar_quiesce_and_switch_g1 Date: Tue, 14 Oct 2025 07:43:45 -0700 Message-ID: <20251014144347.536537-10-sunilkumar.dora@windriver.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251014144347.536537-1-sunilkumar.dora@windriver.com> References: <20251014144347.536537-1-sunilkumar.dora@windriver.com> X-ClientProxiedBy: SJ0PR03CA0279.namprd03.prod.outlook.com (2603:10b6:a03:39e::14) To CH3PR11MB7896.namprd11.prod.outlook.com (2603:10b6:610:131::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7901:EE_|SJ2PR11MB8538:EE_ X-MS-Office365-Filtering-Correlation-Id: 098a220f-886c-4d14-1956-08de0b30373b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|366016|1800799024|13003099007|38350700014; X-Microsoft-Antispam-Message-Info: smYJN2iPjd8GAcLeSGViRNsuyBUE9KK37fX5lJ/0DtCbIi4lnu0xR2jPGRvaHolh7lWXCxNTnWi+6y4sqdUz+SfCIIZ+bp7l0a84Eygn7CiqxSur2uvNRIkFZQ9V7osxGVTR82wHzu1aJvohtA2Ui/Yt6MysltKx+aDAmt/9tAESxKWC31a6AhT5z5BiaH9KNMYNwhaz9r0HfCedtoyZxrlG/cUH+qkat+3vkjH1LoqNgEI55Felmmo+0e5/+NBxD8aq6X8nQkinkLCY0nqbf5W4Tk1jhU7F7oNASUzcwcZwf+SF0nm6PbvvhLqAb8QecbJNIJ72TNqPl3f1VTPD+ciCb1RgIuajQ0FP97GLrBOuxaMtZpKVf1/Vn2PwuhbwAFClG57lpSPLgA4sJNv46o3CNxw4ax5ZS5FXe1v7NohKBqjhgPFOjj7Vs6+MwmHOrLx7riYuBnlvAz+CihULsK11Np6GuO7LJntx/BfUeHCsSGnz7KMvcY7OTX8Y+/C/wEbEaa6uQ1hSSXQhon+DBoPM92T0TC/xyhsE2Viacl0zpda6A5D+05PxVkeUG8oEspuUg8U/MItm1xy8Np9HDekZLzXairOLqZtsKw1oVnj2Edyzx8KIOwqoPBhd62/EibMndkWrYwn5VNDUnyEDnBuiBtw+XD21w0a7z7B9dVpFmvsR4e8ogJIr3iMJvAOxdyx0sXprzq5iKVytGrJd9g/h7aK7iAfNZ8mND1pCXu3zC/sHneiYA4VYvPIZScBngLtjC0vMzAk5wHfTpWQXnR43ikXxuiZ+y0IJQm4eRWCuRXzZDk7maE1Vu+kGvegbG7/IFwHpwDnaL1A0/LXH02MNVHygcOHrUG4NZ78MdmY7+j65f1qo5rz6Wnx+7nn/kvTd7UVEiNm2aDJq+4BCsQnryZ3ngymlvjlYF2hq9aUGYYcQHDM6Cyf1negmaXIipwGw1VGa5S4H+El2k3X5g5QPE2Cd9Y8Ku9cyvrgJHuCoKI/BQaXIQ/8pCZp0F41noOyE6JOazh2r6YOAiFUg4PjRA+F6+ENWaCLmNCvi+KZJzucSrEYPDiD0L/xFxuEQVM5k12isda5uYPRZ5eNknC2qOQUlOHS/1CJRmckA+U1wFc6zazq283bGDkFbEe5+zBKuFYDDBMmO9h2jWmG3NXRbkv7AOtYAZtYTb9M5lUOfzVFgU/vTrNx0icE1OHGnAVaB6PlDkLPBhyY9ZG2dCoU2m0jcFujSGEKFvwXSF8agR7KAtaosxFP08cdpImDaMHPKvd2Jnygf4lexags8fjBgNeBkhKYYxjmszqf0qDPmrqmlL5W5WpBCKSooG9KKJweYHk2mZ/R4K27EjUblo4Wml3SBhho3E3UtepJRiUTNZOphNHGWYhg+PSKE9aiXMFOt/QhNxAB/HvONooGD9PVuidCdXcHSiaAQikV9yq5ZejCTrzzALVQXHrmIFgT0DAPXlHU3wd+JQA5+0jRpyQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB7901.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(366016)(1800799024)(13003099007)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EOQfTJ/xXsenFeI1BwHEb8Zs/0PKS3/QzaSWqM/qugCejBO1FyJRF3G6qYe07k/nG9jE+Q497Jh1kMwFUNXTjht9p1I98aven48dwD/Wqr4dvlH8vH10v3SsIJ9863OvhnLiFb3O46lF5j1QdWZj6sTFJcxLuInjhEmHETq8muZPxo++8/7ukLIQbfXiQE2Le4IFKwKTqOU6nRjnE8isfrkN4O6uAHfloqCdTMULIMpp/gTrZwJ4mGTjUnhZ40Tc5SYStF5pzqjSnJrvI7Kqu3m+vpJHMi6Tmc0XE2qAZPz4Z9cevrGzE/+NoSdn8u/Gx6t6qjvogmrDTh6qYbEnGYdw/8t3gE6bJOG3xACWTg83jD85vUScGbwYF7uZnp8/bM5ATT5CfyQ7C8e1bFBWQ6rPiY7rvTyvnLuNkDEcwSG1GRroP3Rlkoz39gj18dp5gnfZZS7+EKQG1eono+Q5v4V3MgtmdfkfSl07lZ7GCAjB7Ueanx+NuKnnvOJnJ+7OJgkl7L8Tf4tagIPMVEQqfG4dBzRinMA4vsrydk/OZq12dNOzSkqgHWAyrTFZuRd9OjIA98y8Dp2oExZxCjG6ShN8leOtZYHr8KxQ9j70bWMhJzMAjYT76x3pETUBSylwcxGu3PNfVOX/cX6lm0GqkaNeyiW+zM+MPwdzVVCK9y8eixUkBPFnUTHbpToAY20oqZBs9pOwKqJwUDGtxcvSBjHq9BxbGrVvqcoV+7IjTU0YO4NxNpFkZfWOWftfzigOffBA5pBVZ040XNun/cjeamk33GavsnRHPml6BtugV3WkhTPp5/hdfOB0yY8IVxI+QprqXWJosUkX+h3nxKkfNbumcOXIHLU1HcRhqcAt5jCrS3fnTv27FseQhFRv67fKdm8+1h40h7Kpm31B8JIikeCKJNjVnJNc3u/gFslQT4K97ck+mvjkyiCZK9i+hzARAmJBRHT/Az+hnR0q/rkVdQ0d+y/yzqIVm5QtaBeZv4VGJPWaLbJTen0/yEcFK2qB1pBRbM7GxGIshzvLi78Z8rXkFNXlWH0yoAzHA0DgFLBvqrQg5xXu3EKu/nBuIfLq3iQX/5yqSOzrK/Dn6CGKC/O10ItGpuqcQDTymBMMIe5fRNrADOYS4zaNWZlUc43BleqYOahDgPB5CH8ELILn6qRlI8YTI+pIrqq/2gc+R2KP5vKc73bi3W3RqZZ8yCYh4WlWw5fAyWuHqMDMleB2BQI08K9mhEZaOyDcn+9hmNHQJ1x0GC7qLq7eO/dk/Zo7NO5EW1gpP9QLkJlvSmtA79Z16DD7sKHdQEetmOSYUNpA/mcp+j3w6qMjBrKjEL65EI0BR4bdxTP2riDgpjsMOCDuEXs+CJdFOSXh4a3mXJC/ipxiqQKMmZTODI/FOdRc3Pf8wlRes/9Ba+ZreCIFY40+Q88NAbSrh9rEGpy+DLYUEKH7rhLQ3wMcdDXGrqO5UBqPA1Cck8pLBZfPT0Sdu4CO5mI3zMbwYNNmnBNJfnmEsY3jakaD201Z1Pf0PKfre4p75qLCTcIsmyaON9+5NGa00ntr75piRyGrz1XdUeusq+HijSUanDd5VbfYSgzCoCD72IuS69AYJ7fKd29K++NrIQY4BprML1nS7/fWvLI= X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 098a220f-886c-4d14-1956-08de0b30373b X-MS-Exchange-CrossTenant-AuthSource: CH3PR11MB7896.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2025 14:44:44.9917 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uK6/gYZOnVKWIntMrQMBqrhiCxUyYJBThHFH1lv5EinRsnLCfxZ/kkSzQ4eCk0Jj5KEP5haVVaxLhCiIoiDQpyhF770lbp1j8FgtXqpMwPE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR11MB8538 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDE0MDExMyBTYWx0ZWRfX7DtP20+otps8 AjwPC4vY41oFDi2DOAbz+uTNHfKMzMsZS7//KmH7Gpit+KPkaGHxe9hFKD734lJksazZkjEi+eR zH5Pr7E2IKgjJSTqOLMeCjilQcgmYoOyoNwd5E5RK9Z60x9mA6aMVdYyesn2jQCmjWnTV4CjVli dgdEak1fYuMrgoDuxEY5lbUy4H55t+qma8A5SYjiM8c7dgGZtHFC6/4QJhNKNHRAEBpD+JOoPss EbeKdpB/XAW213X7h6hTQbwJryQeyxyKziQ+0ECY2Sw3/PGZWNFqvYiA0SJWsw0IJbdvCiHEmJp M0VT7T0Vmn0zbBYuh8C612o9GJJAxk18ruGCwV/JtMnlkkYC2IDOkdrYDWkCs9Pz/rOdj3gWhl2 Y2/1N86e9bKB5yLBes+UDP2I2q6Ryw== X-Proofpoint-GUID: udSGMMyY1eAGuGbMsCqGbuRfqfGzzCPZ X-Authority-Analysis: v=2.4 cv=JaKxbEKV c=1 sm=1 tr=0 ts=68ee6475 cx=c_pps a=qaGWf3H7ZUycNCJ7m3WmPQ==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=CCpqsmhAAAAA:8 a=t7CeM3EgAAAA:8 a=uyKIICsDoPcSdIl6ehEA:9 a=5OXmESjOoUQA:10 a=ul9cdbp4aOFLsgKbc677:22 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-ORIG-GUID: udSGMMyY1eAGuGbMsCqGbuRfqfGzzCPZ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-14_03,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 adultscore=0 phishscore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510020000 definitions=main-2510140113 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 14 Oct 2025 14:55:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224832 From: Sunil Dora The following commits have been cherry-picked from Glibc master branch: Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=4b79e27a5073c02f6bff9aa8f4791230a0ab1867 [2] https://sourceware.org/pipermail/libc-stable/2025-July/002281.html Signed-off-by: Sunil Dora --- .../glibc/glibc/0026-PR25847-8.patch | 161 ++++++++++++++++++ meta/recipes-core/glibc/glibc_2.35.bb | 1 + 2 files changed, 162 insertions(+) create mode 100644 meta/recipes-core/glibc/glibc/0026-PR25847-8.patch diff --git a/meta/recipes-core/glibc/glibc/0026-PR25847-8.patch b/meta/recipes-core/glibc/glibc/0026-PR25847-8.patch new file mode 100644 index 0000000000..83d9ca01a9 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0026-PR25847-8.patch @@ -0,0 +1,161 @@ +From 20d84dfa0b9a32f88259269bbeaae588744ae4ae Mon Sep 17 00:00:00 2001 +From: Malte Skarupke +Date: Tue, 14 Oct 2025 06:33:50 -0700 +Subject: [PATCH] nptl: rename __condvar_quiesce_and_switch_g1 + +This function no longer waits for threads to leave g1, so rename it to +__condvar_switch_g1 + +The following commits have been cherry-picked from Glibc master branch: +Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 +commit: 4b79e27a5073c02f6bff9aa8f4791230a0ab1867 + +Upstream-Status: Submitted +[https://sourceware.org/pipermail/libc-stable/2025-July/002281.html] + +Signed-off-by: Sunil Dora +--- + nptl/pthread_cond_broadcast.c | 4 ++-- + nptl/pthread_cond_common.c | 26 ++++++++++++-------------- + nptl/pthread_cond_signal.c | 17 ++++++++--------- + nptl/pthread_cond_wait.c | 9 ++++----- + 4 files changed, 26 insertions(+), 30 deletions(-) + +diff --git a/nptl/pthread_cond_broadcast.c b/nptl/pthread_cond_broadcast.c +index 5ae141ac..a0743558 100644 +--- a/nptl/pthread_cond_broadcast.c ++++ b/nptl/pthread_cond_broadcast.c +@@ -60,7 +60,7 @@ ___pthread_cond_broadcast (pthread_cond_t *cond) + cond->__data.__g_size[g1] << 1); + cond->__data.__g_size[g1] = 0; + +- /* We need to wake G1 waiters before we quiesce G1 below. */ ++ /* We need to wake G1 waiters before we switch G1 below. */ + /* TODO Only set it if there are indeed futex waiters. We could + also try to move this out of the critical section in cases when + G2 is empty (and we don't need to quiesce). */ +@@ -69,7 +69,7 @@ ___pthread_cond_broadcast (pthread_cond_t *cond) + + /* G1 is complete. Step (2) is next unless there are no waiters in G2, in + which case we can stop. */ +- if (__condvar_quiesce_and_switch_g1 (cond, wseq, &g1, private)) ++ if (__condvar_switch_g1 (cond, wseq, &g1, private)) + { + /* Step (3): Send signals to all waiters in the old G2 / new G1. */ + atomic_fetch_add_relaxed (cond->__data.__g_signals + g1, +diff --git a/nptl/pthread_cond_common.c b/nptl/pthread_cond_common.c +index f976a533..3baac4da 100644 +--- a/nptl/pthread_cond_common.c ++++ b/nptl/pthread_cond_common.c +@@ -189,16 +189,15 @@ __condvar_get_private (int flags) + return FUTEX_SHARED; + } + +-/* This closes G1 (whose index is in G1INDEX), waits for all futex waiters to +- leave G1, converts G1 into a fresh G2, and then switches group roles so that +- the former G2 becomes the new G1 ending at the current __wseq value when we +- eventually make the switch (WSEQ is just an observation of __wseq by the +- signaler). ++/* This closes G1 (whose index is in G1INDEX), converts G1 into a fresh G2, ++ and then switches group roles so that the former G2 becomes the new G1 ++ ending at the current __wseq value when we eventually make the switch ++ (WSEQ is just an observation of __wseq by the signaler). + If G2 is empty, it will not switch groups because then it would create an + empty G1 which would require switching groups again on the next signal. + Returns false iff groups were not switched because G2 was empty. */ + static bool __attribute__ ((unused)) +-__condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq, ++__condvar_switch_g1 (pthread_cond_t *cond, uint64_t wseq, + unsigned int *g1index, int private) + { + unsigned int g1 = *g1index; +@@ -214,8 +213,7 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq, + + cond->__data.__g_size[g1 ^ 1]) == 0) + return false; + +- /* Now try to close and quiesce G1. We have to consider the following kinds +- of waiters: ++ /* We have to consider the following kinds of waiters: + * Waiters from less recent groups than G1 are not affected because + nothing will change for them apart from __g1_start getting larger. + * New waiters arriving concurrently with the group switching will all go +@@ -223,12 +221,12 @@ __condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq, + are not affected. + * Waiters in G1 have already received a signal and been woken. */ + +- /* Update __g1_start, which finishes closing this group. The value we add +- will never be negative because old_orig_size can only be zero when we +- switch groups the first time after a condvar was initialized, in which +- case G1 will be at index 1 and we will add a value of 1. +- Relaxed MO is fine because the change comes with no additional +- constraints that others would have to observe. */ ++ /* Update __g1_start, which closes this group. The value we add will never ++ be negative because old_orig_size can only be zero when we switch groups ++ the first time after a condvar was initialized, in which case G1 will be ++ at index 1 and we will add a value of 1. Relaxed MO is fine because the ++ change comes with no additional constraints that others would have to ++ observe. */ + __condvar_add_g1_start_relaxed (cond, + (old_orig_size << 1) + (g1 == 1 ? 1 : - 1)); + +diff --git a/nptl/pthread_cond_signal.c b/nptl/pthread_cond_signal.c +index 14800ba0..a9bc10dc 100644 +--- a/nptl/pthread_cond_signal.c ++++ b/nptl/pthread_cond_signal.c +@@ -69,18 +69,17 @@ ___pthread_cond_signal (pthread_cond_t *cond) + bool do_futex_wake = false; + + /* If G1 is still receiving signals, we put the signal there. If not, we +- check if G2 has waiters, and if so, quiesce and switch G1 to the former +- G2; if this results in a new G1 with waiters (G2 might have cancellations +- already, see __condvar_quiesce_and_switch_g1), we put the signal in the +- new G1. */ ++ check if G2 has waiters, and if so, switch G1 to the former G2; if this ++ results in a new G1 with waiters (G2 might have cancellations already, ++ see __condvar_switch_g1), we put the signal in the new G1. */ + if ((cond->__data.__g_size[g1] != 0) +- || __condvar_quiesce_and_switch_g1 (cond, wseq, &g1, private)) ++ || __condvar_switch_g1 (cond, wseq, &g1, private)) + { + /* Add a signal. Relaxed MO is fine because signaling does not need to +- establish a happens-before relation (see above). We do not mask the +- release-MO store when initializing a group in +- __condvar_quiesce_and_switch_g1 because we use an atomic +- read-modify-write and thus extend that store's release sequence. */ ++ establish a happens-before relation (see above). We do not mask the ++ release-MO store when initializing a group in __condvar_switch_g1 ++ because we use an atomic read-modify-write and thus extend that ++ store's release sequence. */ + atomic_fetch_add_relaxed (cond->__data.__g_signals + g1, 2); + cond->__data.__g_size[g1]--; + /* TODO Only set it if there are indeed futex waiters. */ +diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c +index adf26a80..40a74342 100644 +--- a/nptl/pthread_cond_wait.c ++++ b/nptl/pthread_cond_wait.c +@@ -354,8 +354,7 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + because we do not need to establish any happens-before relation with + signalers (see __pthread_cond_signal); modification order alone + establishes a total order of waiters/signals. We do need acquire MO +- to synchronize with group reinitialization in +- __condvar_quiesce_and_switch_g1. */ ++ to synchronize with group reinitialization in __condvar_switch_g1. */ + uint64_t wseq = __condvar_fetch_add_wseq_acquire (cond, 2); + /* Find our group's index. We always go into what was G2 when we acquired + our position. */ +@@ -387,9 +386,9 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + { + /* Now wait until a signal is available in our group or it is closed. + Acquire MO so that if we observe (signals == lowseq) after group +- switching in __condvar_quiesce_and_switch_g1, we synchronize with that +- store and will see the prior update of __g1_start done while switching +- groups too. */ ++ switching in __condvar_switch_g1, we synchronize with that store and ++ will see the prior update of __g1_start done while switching groups ++ too. */ + unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g); + uint64_t g1_start = __condvar_load_g1_start_relaxed (cond); + unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; +-- +2.49.0 + diff --git a/meta/recipes-core/glibc/glibc_2.35.bb b/meta/recipes-core/glibc/glibc_2.35.bb index 7ef2c8cb4c..265dcb9129 100644 --- a/meta/recipes-core/glibc/glibc_2.35.bb +++ b/meta/recipes-core/glibc/glibc_2.35.bb @@ -69,6 +69,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ file://0026-PR25847-5.patch \ file://0026-PR25847-6.patch \ file://0026-PR25847-7.patch \ + file://0026-PR25847-8.patch \ \ file://0001-Revert-Linux-Implement-a-useful-version-of-_startup_.patch \ file://0002-get_nscd_addresses-Fix-subscript-typos-BZ-29605.patch \ From patchwork Tue Oct 14 14:43:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kumar Dora X-Patchwork-Id: 72265 X-Patchwork-Delegate: steve@sakoman.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0BD0CCD184 for ; Tue, 14 Oct 2025 14:45:30 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.web10.18481.1760453121440610995 for ; Tue, 14 Oct 2025 07:45:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=oxGEKwIn; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=2382047737=sunilkumar.dora@windriver.com) Received: from pps.filterd (m0250809.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 59EArZG82578317 for ; Tue, 14 Oct 2025 07:45:21 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=jbwHp4oy0H0+9Zn0RMA+HuvvnovQxrmSIrrIpKpTZbM=; b= oxGEKwInj6HL+ybbycYjhHuzcDm2rlUcLXJXX54x1lp/vAgjABkzLuVg57oZHiJ0 RBMUPYblA1dCI0c5It/mQ22aZWcIXwBMZo0kARkMOxiGyzHTp83Mgahe4TfEajwY B8nspBjaEwka0t0SzV46LMb7z5X2oyFL0j1C54o94h/MDQs4Xd0iiol2I124GuOu iDidleUXg2jWi8XDZVsRhE4i75LkAIAcPidMQmtAYIR/+Q3tMFfUxtNCs1wNHhqQ 2e2t0puQ/mW3ZbIwe2NMS7Fws4OnMReF2xPfx9Up8tNuxNFuTlAlkajSvkboBSxa 7Xbx/OQZef9mKPh54roI0w== Received: from sj2pr03cu001.outbound.protection.outlook.com (mail-westusazon11012042.outbound.protection.outlook.com [52.101.43.42]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 49qprdty28-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Tue, 14 Oct 2025 07:45:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HV/xkk84EbFIYvWaNyKnm8BatsQp+SE4rhb7KdVqmimtNEz2wEVdcfwiBlSwOmpVnYciRtY2Emtcs/LEt9k7aFle5aMURXkSjs3b7UmSCg8DoKFxesoIudGa8kRNoZ+4yBkAOv2Eg5IBwBRawEX7k6CndrZPemvh++cwRdACfKJHjTZUiu4mNd34vyhtHZlpRGiKFTimcMxN1kIVMNTjLnWnvo1DQ2y0qCmO1/NPFsc2uRoie88YXTc+5tGopbFIYPx0rRbEJ0pGULnI8DW5Npl/UxosdaV5IM2DTcWPKP6L4gWCaNKAURM5q5GXMMV1woNWEBdlTC9F/nbVA13GrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jbwHp4oy0H0+9Zn0RMA+HuvvnovQxrmSIrrIpKpTZbM=; b=A8/xwnw0igfvRdUJf2/0s3tUskngS+tAX8mNVuCiNXBfVxDMpSE05XwbnyaH99NirKYB2+Bqd/uUXtz+kwXcVZIz3bxROiTFIq9t8Oti+aXq18BOJ+LdfoH3GQL0GZekh8wkqD24mAfWEcsJuDWwXTPT7NRfsKQMVENnAElx/xLlwa0dlO+4mEOAKNslAKRWXBeAiqPQqWZQfCcTP0RsbUgZ1E09dw/cIvw3PDpmDKGou7XLYAtDHc66vqYcwzZRfRl13Npgwb3o+UiQ1VSsOlfuFf53qrDaprebzRqXR5TW3w9xnCdcqFHleqK3tN/zIrDzVhsrIB56yw+bT6d4nQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from DS0PR11MB7901.namprd11.prod.outlook.com (2603:10b6:8:f4::20) by SJ2PR11MB8538.namprd11.prod.outlook.com (2603:10b6:a03:578::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9228.9; Tue, 14 Oct 2025 14:44:49 +0000 Received: from DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::9fa:eb3f:cf26:264d]) by DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::9fa:eb3f:cf26:264d%3]) with mapi id 15.20.9203.009; Tue, 14 Oct 2025 14:44:47 +0000 From: sunilkumar.dora@windriver.com To: openembedded-core@lists.openembedded.org Cc: Sundeep.Kokkonda@windriver.com, sunilkumar.dora@windriver.com Subject: [kirkstone][PATCH 10/11] glibc: nptl Use all of g1_start and g_signals Date: Tue, 14 Oct 2025 07:43:46 -0700 Message-ID: <20251014144347.536537-11-sunilkumar.dora@windriver.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251014144347.536537-1-sunilkumar.dora@windriver.com> References: <20251014144347.536537-1-sunilkumar.dora@windriver.com> X-ClientProxiedBy: SJ0PR03CA0279.namprd03.prod.outlook.com (2603:10b6:a03:39e::14) To CH3PR11MB7896.namprd11.prod.outlook.com (2603:10b6:610:131::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7901:EE_|SJ2PR11MB8538:EE_ X-MS-Office365-Filtering-Correlation-Id: b83c7af4-4cd6-4536-5c54-08de0b3038ea X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|366016|1800799024|13003099007|38350700014; X-Microsoft-Antispam-Message-Info: zi+O22A+QNzG+zY0HZ34HxpHRTYFUFlX7J3eI9gi/MPfjlpYRVrZFp1faBe5cy0zggnH8Iq/qAM8dyNHLmuuNeJSyZVPkAHUTCrU9rMNZTnd9NVYRqKCLjRw9WPZn6ESb563zorG7DgFY9/+Uxm+kvz5sKXanwyHr77Xd5jXp+VFclZwL7VK07HbIvmAkXMKdOg2whOT0EGmUhEAkEW70Dur/3FEgdPq3ZFk1nm51MfjiQawsHtg1h/29bY0stjE2hsxTE3ljKNf09Zxtb3XUPLeRll2gxzQXHY5SHMx9AQ3GFc4vqqsJn7nAGNDHNnqytwQMUO9Z05kETaotiNpOjcyPtQspjLvqPVDSLgxGm2ED9CzLYjhCXnAk9xJf1RTvqbV0ikv1iTeSQ7PA+cdFpvVUpmpUyMlOvjO6Tr7cVMLyeGPUTukZzUyUhdjwKmJKZ/qYqMuWEmuxpyiPE85hRM2fw7z1wbI6IlotasBvaycZIaZ1GTAdILi5Hj7Eh90HZJrHeLa1A/yBP5RpKfexQE/tgtcTl7sT9mchfTyf2c2XuHsIAf682n437XtPqjctX9OjMLT0dU/KVFFsXpTY356NPE3vX6ET3YAN0Uyape1QyFwIocA1al817RKdUgxIsH1xOKM8Q11nO28svk6cIlOoyakfzGwveHTuEFcN/cyRgYg5Z9rRbHKonC3KiXKObeCnw04Nqq+Rqcn3EDjJb/UaKrc1EyhJp1YqeQvy5eyCfIO5KGKb7+6JjPi7MLvw9Qe6MWlvk9wOBoh2fxumYJJ0zvDLHjdoZM+td6exZOFsvbF4svYBeED46MmFe6SHMpWzdVXXXzMypGNR3+wugnnSGxoHIQnvsgJ0HlVgo+kOXLBaZm4RSTGuwur3wFKrbVgL18jxl8I8VNBoY74nXfON7aegrN2a9seXy1ecocfgD8+5NolUpitN+V/WvRWQ6d6ijALmpjynZ0snrDXStHh4JMVSnOr72HXm9g96ibOV8+Mvwwo6m9+exdUxUKUvy0TLXS3mtiNItmkwmdOAOhm6ajCcRByWZ5rlWIurP6Xb2BHbaGjset/Z2bLOAuwmCBp6mdbOpB0REQZ3Sqml01WdwkGQX6DqDk78Nk4hypqcO4xEkjjuzSTV0nlhZ2h+W6XNhzfz1KkpkW28l+Sp8CMV+TsdeELpaYNuMQagWLmxsUkuE5uRFYbmdPh5hbXxuAjSvY/1RazVCQeXTQARMD5ehcQdwSoeqtRCebOYaOcTgX06nDsdps2ExRFh/tP3Fj/R1hE2ruKXWs54cZ8A3XBP1IJ/Q7KCnt0w02xuMMv1ONUonM6lRpHeFSJmrDAE9cELv+riL0C6rGi+rra9tIIXQNdzTz7b+S+V8Cc4Tne6aWiDSXoAvSNwXFMDoGDrYf4BurmXcBrFDPbBJtTIkpKsBh0ax16bOU7HLDs09RU47CmhT2DOxr1M7EIVo6UpCwgZxKW+RjaTNxLXA9z/g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB7901.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(366016)(1800799024)(13003099007)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: A/g275EF5tHMXOv4Tg0Z1cet19+QtMD0aEV29eg0ORRtxw46yb+mJaGtc7yLq9jeRK0AtQyrQSqtpIem/beHRMG/RgpNa4+jL/vcyo5vfY/ffl8htE0NBnlRDNY6Lu/ZwPJ8b/j8GHDYJTScBugZef57sITzcsske2UgOmAH/hCsHg4eq2AhIEM/YrRRg/W9dkCWmWWGQi8/dZX1tC/+o/iIWZh3PXERme2HNzv+On8FMGUAo6OkvPDMmW23E8hcH0LOWF4aE4VLPoVPWbViRW5uErFjC+2VaRDrmaYKXRHxPtv43LtrGwkSkOKOfci6TXyXoM2ZB/pZGKwmLJBlSuas/dXlYeKCfvkyNjU9oJ9Se6u1gL+cbxU5zBcS+eZkz9yxBSRTlMWP2unehn57Y++TPKv4auTQCdETuivBVijNvsCJ45xwbXf/TtR/KcSFdcNTg/dpR7OeDJk12zaiQhLKSieMnIVlUD8QTEz92bAGhoWCzYXYzl13S0TF0j/NAHniiHtknS8MBLSosf6IFCstE2zloKn7SbpMFT4PGyZQbn+kouWDn1bsUuvXdC+MTABB5VEzo+TAz1ta1GYXCQ1bLW6w4+RPaQ1pJmCxl2vZcjqswUlE+YJQsZeFhroR9J0cSMPPCdsPdUyd97wr6kUX1/ibimJYw8et4la6ukZJmuAWSUZRn3Kbnxv6cLk8F0aCcWXf140RqRORZg2hz7vW01/uZkSy00KCXdztP/vAjs6o6vOYpRYpzX2v6uCW12G7+u+dufxy2lzWlkhJfOTSGdNOoSeQW1HLFtyz3DTCP0jiSAZJfc6Z+wtE/LyBdRrbYbRgwlYLXqyjLMF5JKiWNdzqlyobZE+BQSnIvTZNEifL1n32RMa1YkXEB2wX7R2sA2KAwTeBQkFDPNYkQn4vr8zLoAh6zC6uuDvccSC36Y7gB5wZ9GeIFOAIVJn3MfAV37wVzA0reTwOc/BXPndZcfbraU6Hk67eCzrG/D9VPCgjf8Nsur+7d++nVrBNxo/kQdBxhgc+TSIVnakLQgOOIT0w5h9XQApLkj1dzfE5v0/r7SxetMeKkCecjDEjbRwNiw0Iyo1FPKACxIZSCvT0TCaCANNCcjQeOtE8mZmfuMkqTBJa0OfND11PaPc82eRHjTmFds3LHRUG8ZQcma852JPt/l+u47COL+KYDE+0/4nX2fh/goihzAL9yKqo9qRFvcFkjMUHXVWZPPtan6GH8e7fgl8/3Pk5pD/neKBRSVELtGfVroV8aEFzOddhoak5gWcgdEh4WAJjfHCoTh/PErmmKJz45Hpcq4V8yDWxmwFIfoD0BiCzXK8BljlbetCcnBvzAdR1TNTU+E6liuknQCMZ9VBkfVqfEolgS/DADTdlQoHauMoaE7xwzNbPGSKrLpzzNGbV8t2xH2VyJe8G6okzBthECkBbeMkPWLwigXDVlyxWoY0WoxbINCA4HMvVF+9Yjebsq04q3e7HCjBW+r1ZGmM/su8rH3lEn854VVlD5CTWOB3tSY7XLRqOg/wUCPxbNI6Xah+Y7PeB4P5MUqflrukDHv1n/wkZdxR0ekt4CL9ns9fjbrq29bgcutAXCFs32GkxYpL7zmpqeTZ1TbK8QWt6mJd7zsEvDOU= X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: b83c7af4-4cd6-4536-5c54-08de0b3038ea X-MS-Exchange-CrossTenant-AuthSource: CH3PR11MB7896.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2025 14:44:47.8343 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +8/tvb6CaVQqd7sOdJwkNhSON2LHHEUpzPPgK8cfBm7XP9lZS7SEHVKYyRSiIwtcmr4ExykmYVC3w0tZUJ46h2MuxzL8VRWlqJa7HW3Xwns= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR11MB8538 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDE0MDExMSBTYWx0ZWRfX0Y8bS4fHlJsr SNryn+odSeoXafAGs5fbWuj19PAgQTIYEwPEnfVPUGK0IMkC3VYc7hEmm2/URo8vVuyOSUieKD6 rlgQOyh29+r2rJ3fT/36NZ2bKVSOK6z4QSHuO5V0t/MusmA6DWkIz/ukxEoUroYCavtK6IQDcNZ f9tVQjR9gigOYjm61JVh4kVGt28+Ruba8B9nZd8kpx8tV3Kb5rjeGqOs/XjFp/NT+gOdiO3zp22 zMn0WTjLWkOpCcKEbLBsirO6Cni/WyKztRHUgdlMqSfplJvjjDACu4keGwKOLW1MXSdWoKDwof2 Jfrq7Hv3FisF2RqbSLwGOSvWXe7QyiUrj9pJVx6iUh34b1qjmS7LRqvaKbeoPIrEQ33WREXK/dv K4+XUmW8OB4oHAIkRSWjv7jFDKzbUQ== X-Proofpoint-GUID: FuQG6hqiTokA1SSG-Q4MRFTPH1u_Dzy4 X-Authority-Analysis: v=2.4 cv=JaKxbEKV c=1 sm=1 tr=0 ts=68ee6200 cx=c_pps a=vwzr6GK/qOZR+/kkcyjBFA==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=CCpqsmhAAAAA:8 a=t7CeM3EgAAAA:8 a=X6uU5uM_jJMz_PZaGGwA:9 a=bmfxkABXaUYA:10 a=ul9cdbp4aOFLsgKbc677:22 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-ORIG-GUID: FuQG6hqiTokA1SSG-Q4MRFTPH1u_Dzy4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-14_03,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 adultscore=0 phishscore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510020000 definitions=main-2510140111 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 14 Oct 2025 14:45:30 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224829 From: Sunil Dora The following commits have been cherry-picked from Glibc master branch: Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=91bb902f58264a2fd50fbce8f39a9a290dd23706 [2] https://sourceware.org/pipermail/libc-stable/2025-July/002283.html Signed-off-by: Sunil Dora --- .../glibc/glibc/0026-PR25847-9.patch | 193 ++++++++++++++++++ meta/recipes-core/glibc/glibc_2.35.bb | 1 + 2 files changed, 194 insertions(+) create mode 100644 meta/recipes-core/glibc/glibc/0026-PR25847-9.patch diff --git a/meta/recipes-core/glibc/glibc/0026-PR25847-9.patch b/meta/recipes-core/glibc/glibc/0026-PR25847-9.patch new file mode 100644 index 0000000000..49815c6fb7 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0026-PR25847-9.patch @@ -0,0 +1,193 @@ +From c2677e68956bb9677d8de4ee6c5341b1a744d490 Mon Sep 17 00:00:00 2001 +From: Malte Skarupke +Date: Tue, 14 Oct 2025 06:40:57 -0700 +Subject: [PATCH] nptl: Use all of g1_start and g_signals + +The LSB of g_signals was unused. The LSB of g1_start was used to indicate +which group is G2. This was used to always go to sleep in pthread_cond_wait +if a waiter is in G2. A comment earlier in the file says that this is not +correct to do: + + "Waiters cannot determine whether they are currently in G2 or G1 -- but they + do not have to because all they are interested in is whether there are + available signals" + +I either would have had to update the comment, or get rid of the check. I +chose to get rid of the check. In fact I don't quite know why it was there. +There will never be available signals for group G2, so we didn't need the +special case. Even if there were, this would just be a spurious wake. This +might have caught some cases where the count has wrapped around, but it +wouldn't reliably do that, (and even if it did, why would you want to force a +sleep in that case?) and we don't support that many concurrent waiters +anyway. Getting rid of it allows us to use one more bit, making us more +robust to wraparound. + +The following commits have been cherry-picked from Glibc master branch: +Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 +commit: 91bb902f58264a2fd50fbce8f39a9a290dd23706 + +Upstream-Status: Submitted +[https://sourceware.org/pipermail/libc-stable/2025-July/002283.html] + +Signed-off-by: Sunil Dora +--- + nptl/pthread_cond_broadcast.c | 4 ++-- + nptl/pthread_cond_common.c | 26 ++++++++++---------------- + nptl/pthread_cond_signal.c | 2 +- + nptl/pthread_cond_wait.c | 14 +++++--------- + 4 files changed, 18 insertions(+), 28 deletions(-) + +diff --git a/nptl/pthread_cond_broadcast.c b/nptl/pthread_cond_broadcast.c +index a0743558..ef0943cd 100644 +--- a/nptl/pthread_cond_broadcast.c ++++ b/nptl/pthread_cond_broadcast.c +@@ -57,7 +57,7 @@ ___pthread_cond_broadcast (pthread_cond_t *cond) + { + /* Add as many signals as the remaining size of the group. */ + atomic_fetch_add_relaxed (cond->__data.__g_signals + g1, +- cond->__data.__g_size[g1] << 1); ++ cond->__data.__g_size[g1]); + cond->__data.__g_size[g1] = 0; + + /* We need to wake G1 waiters before we switch G1 below. */ +@@ -73,7 +73,7 @@ ___pthread_cond_broadcast (pthread_cond_t *cond) + { + /* Step (3): Send signals to all waiters in the old G2 / new G1. */ + atomic_fetch_add_relaxed (cond->__data.__g_signals + g1, +- cond->__data.__g_size[g1] << 1); ++ cond->__data.__g_size[g1]); + cond->__data.__g_size[g1] = 0; + /* TODO Only set it if there are indeed futex waiters. */ + do_futex_wake = true; +diff --git a/nptl/pthread_cond_common.c b/nptl/pthread_cond_common.c +index 3baac4da..e48f9143 100644 +--- a/nptl/pthread_cond_common.c ++++ b/nptl/pthread_cond_common.c +@@ -208,9 +208,9 @@ __condvar_switch_g1 (pthread_cond_t *cond, uint64_t wseq, + behavior. + Note that this works correctly for a zero-initialized condvar too. */ + unsigned int old_orig_size = __condvar_get_orig_size (cond); +- uint64_t old_g1_start = __condvar_load_g1_start_relaxed (cond) >> 1; +- if (((unsigned) (wseq - old_g1_start - old_orig_size) +- + cond->__data.__g_size[g1 ^ 1]) == 0) ++ uint64_t old_g1_start = __condvar_load_g1_start_relaxed (cond); ++ uint64_t new_g1_start = old_g1_start + old_orig_size; ++ if (((unsigned) (wseq - new_g1_start) + cond->__data.__g_size[g1 ^ 1]) == 0) + return false; + + /* We have to consider the following kinds of waiters: +@@ -221,16 +221,10 @@ __condvar_switch_g1 (pthread_cond_t *cond, uint64_t wseq, + are not affected. + * Waiters in G1 have already received a signal and been woken. */ + +- /* Update __g1_start, which closes this group. The value we add will never +- be negative because old_orig_size can only be zero when we switch groups +- the first time after a condvar was initialized, in which case G1 will be +- at index 1 and we will add a value of 1. Relaxed MO is fine because the +- change comes with no additional constraints that others would have to +- observe. */ +- __condvar_add_g1_start_relaxed (cond, +- (old_orig_size << 1) + (g1 == 1 ? 1 : - 1)); +- +- unsigned int lowseq = ((old_g1_start + old_orig_size) << 1) & ~1U; ++ /* Update __g1_start, which closes this group. Relaxed MO is fine because ++ the change comes with no additional constraints that others would have ++ to observe. */ ++ __condvar_add_g1_start_relaxed (cond, old_orig_size); + + /* At this point, the old G1 is now a valid new G2 (but not in use yet). + No old waiter can neither grab a signal nor acquire a reference without +@@ -242,13 +236,13 @@ __condvar_switch_g1 (pthread_cond_t *cond, uint64_t wseq, + g1 ^= 1; + *g1index ^= 1; + +- /* Now advance the new G1 g_signals to the new lowseq, giving it ++ /* Now advance the new G1 g_signals to the new g1_start, giving it + an effective signal count of 0 to start. */ +- atomic_store_release (cond->__data.__g_signals + g1, lowseq); ++ atomic_store_release (cond->__data.__g_signals + g1, (unsigned)new_g1_start); + + /* These values are just observed by signalers, and thus protected by the + lock. */ +- unsigned int orig_size = wseq - (old_g1_start + old_orig_size); ++ unsigned int orig_size = wseq - new_g1_start; + __condvar_set_orig_size (cond, orig_size); + /* Use and addition to not loose track of cancellations in what was + previously G2. */ +diff --git a/nptl/pthread_cond_signal.c b/nptl/pthread_cond_signal.c +index a9bc10dc..07427369 100644 +--- a/nptl/pthread_cond_signal.c ++++ b/nptl/pthread_cond_signal.c +@@ -80,7 +80,7 @@ ___pthread_cond_signal (pthread_cond_t *cond) + release-MO store when initializing a group in __condvar_switch_g1 + because we use an atomic read-modify-write and thus extend that + store's release sequence. */ +- atomic_fetch_add_relaxed (cond->__data.__g_signals + g1, 2); ++ atomic_fetch_add_relaxed (cond->__data.__g_signals + g1, 1); + cond->__data.__g_size[g1]--; + /* TODO Only set it if there are indeed futex waiters. */ + do_futex_wake = true; +diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c +index 40a74342..d7e073ab 100644 +--- a/nptl/pthread_cond_wait.c ++++ b/nptl/pthread_cond_wait.c +@@ -84,7 +84,7 @@ __condvar_cancel_waiting (pthread_cond_t *cond, uint64_t seq, unsigned int g, + not hold a reference on the group. */ + __condvar_acquire_lock (cond, private); + +- uint64_t g1_start = __condvar_load_g1_start_relaxed (cond) >> 1; ++ uint64_t g1_start = __condvar_load_g1_start_relaxed (cond); + if (g1_start > seq) + { + /* Our group is closed, so someone provided enough signals for it. +@@ -259,7 +259,6 @@ __condvar_cleanup_waiting (void *arg) + * Waiters fetch-add while having acquire the mutex associated with the + condvar. Signalers load it and fetch-xor it concurrently. + __g1_start: Starting position of G1 (inclusive) +- * LSB is index of current G2. + * Modified by signalers while having acquired the condvar-internal lock + and observed concurrently by waiters. + __g1_orig_size: Initial size of G1 +@@ -280,11 +279,9 @@ __condvar_cleanup_waiting (void *arg) + * Reference count used by waiters concurrently with signalers that have + acquired the condvar-internal lock. + __g_signals: The number of signals that can still be consumed, relative to +- the current g1_start. (i.e. bits 31 to 1 of __g_signals are bits +- 31 to 1 of g1_start with the signal count added) ++ the current g1_start. (i.e. g1_start with the signal count added) + * Used as a futex word by waiters. Used concurrently by waiters and + signalers. +- * LSB is currently reserved and 0. + __g_size: Waiters remaining in this group (i.e., which have not been + signaled yet. + * Accessed by signalers and waiters that cancel waiting (both do so only +@@ -391,9 +388,8 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + too. */ + unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g); + uint64_t g1_start = __condvar_load_g1_start_relaxed (cond); +- unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U; + +- if (seq < (g1_start >> 1)) ++ if (seq < g1_start) + { + /* If the group is closed already, + then this waiter originally had enough extra signals to +@@ -406,13 +402,13 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex, + by now, perhaps in the process of switching back to an older + G2, but in either case we're allowed to consume the available + signal and should not block anymore. */ +- if ((int)(signals - lowseq) >= 2) ++ if ((int)(signals - (unsigned int)g1_start) > 0) + { + /* Try to grab a signal. See above for MO. (if we do another loop + iteration we need to see the correct value of g1_start) */ + if (atomic_compare_exchange_weak_acquire ( + cond->__data.__g_signals + g, +- &signals, signals - 2)) ++ &signals, signals - 1)) + break; + else + continue; +-- +2.49.0 + diff --git a/meta/recipes-core/glibc/glibc_2.35.bb b/meta/recipes-core/glibc/glibc_2.35.bb index 265dcb9129..26e8d8c408 100644 --- a/meta/recipes-core/glibc/glibc_2.35.bb +++ b/meta/recipes-core/glibc/glibc_2.35.bb @@ -70,6 +70,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ file://0026-PR25847-6.patch \ file://0026-PR25847-7.patch \ file://0026-PR25847-8.patch \ + file://0026-PR25847-9.patch \ \ file://0001-Revert-Linux-Implement-a-useful-version-of-_startup_.patch \ file://0002-get_nscd_addresses-Fix-subscript-typos-BZ-29605.patch \ From patchwork Tue Oct 14 14:43:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kumar Dora X-Patchwork-Id: 72264 X-Patchwork-Delegate: steve@sakoman.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B624CCCD192 for ; Tue, 14 Oct 2025 14:45:30 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.web11.18544.1760453121792093888 for ; Tue, 14 Oct 2025 07:45:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=Ib2mDxIo; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=2382047737=sunilkumar.dora@windriver.com) Received: from pps.filterd (m0250809.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 59EArZG92578317 for ; Tue, 14 Oct 2025 07:45:21 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=K/z7SSuxcIQuBfEmEo7NiAVkOCLMfFiBsOqcQoYBuPo=; b= Ib2mDxIodffNUJZAJYqvMYtf9ZUPCCj6FewYPiRtXmNKVPPB3RShTiPJDh/zwEXf hr9vnUVy4alZUwzYsvb4Vm79t9kAbN5mX8a/puzh2tdLmplCWDnXl3D4rKVNKWJR VhhyUlAI/clp3KRex/8aFtlKYpFXTiM0Wywcn+Ka1Hz3TOsCBfSBaGOAvk1C4djN NCeCizaCGi57GkCYrAW6BgpB8xPxRDKW2tSvXWAykJzLLOkVof3h1PIIgLZqplrX ktA0Me/TSyJPygGf0mF7eld+D4OsQlsW5cJ9FPA1SZLxXhZrTUaAlP8KNa6XIlgh tqEqLqRnLibPB93/3rLYhA== Received: from sj2pr03cu001.outbound.protection.outlook.com (mail-westusazon11012042.outbound.protection.outlook.com [52.101.43.42]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 49qprdty28-2 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Tue, 14 Oct 2025 07:45:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IUUbiHeHoDtRFlZTgWi1gatveiqcshzvk7G9FIphtTYSiH9RkLM+YoH8t+cFT/yb9VPYnQtFVC13pLTC/WZBtOMEoRDWXrJSHAG8Sd+eNBvJyWi+NHiSuP7exbN44Y15v8m7qehzGjsfrk7nMIDXJnpsVG6a6u4IslxE/x9BTiHkswZeW9rg9d3MgZSttknwkUVEfBZTeeVuGC5CngnBTePcN6CIC7SVhNwmtkIQtGlWjgsz5NTOQiRHPGMzES32PQTIfCX00IEAnTyAMXiWB1QCSdUQ2NJ1eeAy+OcyVkgXqjjSz7LRY/2tZ7uIuzkZ3ltU6yKTtXAFZ3cf7xYckw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=K/z7SSuxcIQuBfEmEo7NiAVkOCLMfFiBsOqcQoYBuPo=; b=xZMFqAi+GYu7agjURB4GgTW8QFk8w2tfxuia+Llfsvq5+b27dbaqayB9CojAUYaFuhV3jnZ9GBe83UawIiBarC4jsxkJlfQclGhyQWz8Gv7KLu/TnqpxSyBhXaBLm+rXQeaTXuhwr41BS7iXVnzAyZmJ1qx4j6pDX7gVA1Km/RF9kczyjVEwDL05XFJUQnPX6YzX5qTutjXeCtZX4QBPTFuYd0NkSi1+mI4SYnAGSJgu66GQeJC9MKHp1yMY07qfHQggjaw2WXrHDMaWOPoTYhT/oye+9VHnL2X8gt9yDWPt9wFCULzx5fphttTCQy8KJ0cPoG/Sy2T/mPuMiHjcJQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from DS0PR11MB7901.namprd11.prod.outlook.com (2603:10b6:8:f4::20) by SJ2PR11MB8538.namprd11.prod.outlook.com (2603:10b6:a03:578::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9228.9; Tue, 14 Oct 2025 14:44:50 +0000 Received: from DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::9fa:eb3f:cf26:264d]) by DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::9fa:eb3f:cf26:264d%3]) with mapi id 15.20.9203.009; Tue, 14 Oct 2025 14:44:50 +0000 From: sunilkumar.dora@windriver.com To: openembedded-core@lists.openembedded.org Cc: Sundeep.Kokkonda@windriver.com, sunilkumar.dora@windriver.com Subject: [kirkstone][PATCH 11/11] glibc: : PTHREAD_COND_INITIALIZER compatibility with pre-2.41 versions (bug 32786) Date: Tue, 14 Oct 2025 07:43:47 -0700 Message-ID: <20251014144347.536537-12-sunilkumar.dora@windriver.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251014144347.536537-1-sunilkumar.dora@windriver.com> References: <20251014144347.536537-1-sunilkumar.dora@windriver.com> X-ClientProxiedBy: SJ0PR03CA0279.namprd03.prod.outlook.com (2603:10b6:a03:39e::14) To CH3PR11MB7896.namprd11.prod.outlook.com (2603:10b6:610:131::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7901:EE_|SJ2PR11MB8538:EE_ X-MS-Office365-Filtering-Correlation-Id: 275f4f59-498b-4917-837b-08de0b303ab5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|366016|1800799024|13003099007|38350700014; X-Microsoft-Antispam-Message-Info: mhzv2YbuYAtQ1aYxZBHScdfv1lng+SoK4WhG9XUbjGvQzcGPugJbgq8wE6wtEpCNH8lxsm2OCMP719zUeLdmwb3B3eAd0k1I7lfa6KAnUdeg242RH9K30YcsP79D9FD9rjRzt1nG3UbdTggbhW9SskAqPMqUm+3MVs5IyayED9/rLRRju3Wx6Vg/GK+k1P75dnV/spoac7ZzvrwEipKEANEUT9ip/CgvVBdaGG3nTwhPQnS4oXsCOvmu9M3r4lEJY8v1iZyRz/tBhGEHU9sBNn6oPJIw9lF79Z+XktHrb2iFE/BSAjlpaLbN0x/fZ9FPhIVRe+uNqS8raLYMXxZuQQ0EEtzqIUuhey+gJG3K/qGNWU9/OQAaguxTugiOR6U7qt1fEFM0rXiGQ0Ml88A7Pc4VVmEQEsvxec0nsPK3gEMYXarkXm+Hi9/jDsVbITckH92RFDu4NEw5X3dL7N5fyG7jJFTOWVNQ7Fg4iV4q5YXWl9mgWetgSjZsGGnAJYRtCOMuN7PrpDko0SU4Q4/ELFof16GgzpfR3+Cg2Z2Mjqj7BTGfBKCYHyBBqVsHUohdXm2S2U1F8Zer8bjWngodfvEYqE8DDiXs74XyYMCOVW2KZDGX+cGC5xM85Z78TPnmZkKhJxTQEi10ah8WTua6PZxUVI1Fo7Kylkm80imFZGLbJzn7TgPTpB4CupBzuD4oqtdg4ZNC0O9krIah8ZDbe33xyjHO8F7E3/Zm351cu52Ngbf1ILtWB2O45k9yOM/IEZHrpJndB07UIR0lAswwoQlOC9rGWhJA9SsQnGfS9o6/CIlS/zaSr9HbwsHRo4dzjROR35xgYeJwHaxhL5svJj93TYuaPEuf2RblUMbwI/yTWCJZ0FmotkdmN58Hy5H53YO3YcV5SDgK/NBRKMofASmpGAapOSKZP6aWAtDppT7Ir2D9jIMofrWTa31ZzQRLEIQA/yeeAY9PPZXGY2kxf/XPF+F8H77+uPwtpYdjnGOq+3SRKlngs9bfwUGG58zkMjhfM0qGNf6BDbYqIuYpY0cB19vkpg3FdOBOduWRl8AQ3IKEB4mOT3TjSKzz8rr/eFRisrF9cBDuyhjghLs8v8hm4J2GTf7hDqqd3GhiYniqNi8nhXOp37kxoOn2dFGWJCREqr2Z7cFhHBhoES406Qf6fM88B6Wo1KWhiWWq2xtVefIlKNr2wRJnWZGq24gzXS0wXpApbgzJ675fJWTTP+ZLY4YiKynb4DkxUBGghyKD/XKUDfTZWS3NHm6ovz8amtnV97v6zd6A243l2zDFAiBCkUNXDTEMHIt0yIgyy/69wdCSpdzpgebR+B2lcdKiDzpkmU4cKR8DkDBzGSUk0JtS27Q0JQWRRKMN7lVeeWwjYJ4lBUXderr31H13U13u72fkYz3NZweNmA9p81GWBQs1MM6SkrmSHbTW0EhKwodP7rhous2Hh5pr3S78H/nFLEt4yC74jy9EID1Vws5q4w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB7901.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(366016)(1800799024)(13003099007)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9UsuLgwcDHVJNfATtkUUFd7m16g5wgAFtKFALw8uDcJ9RQ/QunlLE7agXrnwDs/ggbVx/QJK6t0/Peb1PPL1IaWRYNcE7QOI4zVW/Yq925PHm0GX0iqdPiJfvd9rnoLIz65adZeq2r1lM1P6OWPtljf5O4A+vm50JeivoHgP/2WXqcToj59c5qS8VMWBSaWczksNfF8IlAS5dSc01nFJf7JhrFX9Y19udkb6vvO0+n7QbVTcAVjKS1o1MRoCos+FE47S7Hth/M4nfBWbxuIiAyZYJMdRU5yCXT8fMNzK8GDYklZxcpD+S0QJ2BsF4xoJLzGl0k9LgcYUXQVDiVZmbr9A4V9opH3CXXt03xxBvPm/35hwHL+Ym59QvZx6/lvIpcrFWdybTSnzxIvX8qOdzaozxBj49L+LeStXXmT26o/UdTeBbTpXljuUS+xp1G1CYuhZBER7yMpHyRDWaoljSyMrhB+hz253iJgcPR8ofx5LXY4bhAoqCkcJcew4o+li2NP9bbZ3bq7wZ4/Ehn1fG7Wd1ulTRgu9+dzYO47kkBYQ2NlF++NfaR8cARuy8MP6d1icm4tFnXBfkoiXjJsLTVXLpWklWle1dftz9aqE6FnECcoYokfYClY8OArzoinR/sLvJK+RfsxI8yqc7UhDtin27JI498XyOPaYoato0XarQFShupKi2ENySlmTjLxK4VUrm6BNofc4mnl/bcq7jcVi0KILLTBENBQu17swVeDmLrB06D7O8QpN0bjMa5i1jDW1nJCBj+rbTrq2DuYdW7XfILDchOzXJ/Ms3NNaHprVpGlqIetlqZrsk/PiDsMtS2ad1Iae+S6RP6IdW5WldGkOwCoE1ztPsomn/AWSWiiWYPVdot3qjXXDK6TWki59b/p7F2My7x0YrEs3RjWblV5xfwJssN1P3+5Zh+vrj9AiQG9vd+RMLrOHhRz0IQuXFTtmX2YUOd1H4xW2wl5O340SQ0EaeOwJyNIsMsI16iMQzxkDRKQhSwvC3yg8dSjZctSZH0XJJWxPbsrHCB4nJ6qKkKasPRfATf3QlQBx3t7Sf4wjK3v6wxTeLtG7sXYYwuoZiQDWIoGvmenEH7Adik0ev9SwxNkUWBHEj3RYnTql9cPKOwsb67/eGtjye/aPlmveYsFwdxz7gCOQBoOU90E6VeX8qbAcmpvbvSobjZNZlvK0zsieQDiX1QcVqZKMgqvm5/ByYe1vWiui66sc5lQ316jo5b3HBROFBEsL6N9OV/2x6XnefYM7rRp3pwajAD/70hUJJqA+XpGbT3P4sDDVxzFINjFE1nZZLJNGg/9istp2OcWvymkgOpYi7vryJs9mzfP3q4gqNz/J9Ikkq6PnXfXkcyU1sB9/ctPlam2/OrXzJGlr9fRyT6xcBCIopiyVsAnqTyh0TKnOhaGyBG731pn3063J63fHR+rxXXIeN8IV2R50GQPW1qlvRWFp4Q7FsNvKUxxHhGfTFBQxxweE5p4o4aqZb/s/utEmxJaNCPbAcXYGRAWu49GzmDuNRvTZ145LImgUTyGHcEpZV18N00z0nwDWdM/Y6eiHDx/Q9joIjxCSiaxBY66zqH/+gEHfaaOwNJNl9wYWfj3Spw== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 275f4f59-498b-4917-837b-08de0b303ab5 X-MS-Exchange-CrossTenant-AuthSource: CH3PR11MB7896.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2025 14:44:50.7997 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: U7FR7zy9M4j6Lvo/VQB76llGl6cHZb6Ymluys9ZyYv+1EUEImGK0fKeQoVxlDPNTak038Qo9/jXDKnv/vAT+kbMXFu4m9DDzMIJuK5Po188= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR11MB8538 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDE0MDExMSBTYWx0ZWRfX8Q9ah3+KtAv5 YCmHY2qQckbQ2Cr6owBrOvwioLeUGW4LxQc3d4xjVkUeKzdhW7W9j9OOCiUH600u/w6pNGLV+6d 5fIIhAtfsSRsPA9/VoPqSa4F+OF/JB1KOKJqZJYxO7oudkESTyuVaSvsThG9ek3KSxjXJXmInUj mnzOHVgi6W496hJ9ZpHEyLNFcvBNn6cbgc0DTblK6T+pMP8+wYW8nPCvNEr4JQWej7CGncPdry5 URF7Bjyjw1MmztcQ1KMye0S8LcD2QhzEg0V+zk2UrWY6aF3+gXkGn9IbQYcH2mpelCa3dWW1tWH 6WGWpj9mQlKwl68GGFjwhWXrbS8UeOwdQES5/RfyUFiMQ1RU5FxE6zs2jfIhMFbiodc9lfi/dAX v03y5dH7LDSJQKVEchm5YatEI89caA== X-Proofpoint-GUID: IuS5M9gtGIn5OvYPD1gZeUcq8ufASe6N X-Authority-Analysis: v=2.4 cv=JaKxbEKV c=1 sm=1 tr=0 ts=68ee6201 cx=c_pps a=vwzr6GK/qOZR+/kkcyjBFA==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=CCpqsmhAAAAA:8 a=t7CeM3EgAAAA:8 a=20KFwNOVAAAA:8 a=p8ygwoizOokfcXNiYjMA:9 a=ZDAW-G3XH58A:10 a=ul9cdbp4aOFLsgKbc677:22 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-ORIG-GUID: IuS5M9gtGIn5OvYPD1gZeUcq8ufASe6N X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-14_03,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 adultscore=0 phishscore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510020000 definitions=main-2510140111 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 14 Oct 2025 14:45:30 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224830 From: Sunil Dora The following commits have been cherry-picked from Glibc master branch: Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=dbc5a50d12eff4cb3f782129029d04b8a76f58e7 [2] https://sourceware.org/pipermail/libc-stable/2025-July/002282.html Signed-off-by: Sunil Dora --- .../glibc/glibc/0026-PR25847-10.patch | 54 +++++++++++++++++++ meta/recipes-core/glibc/glibc_2.35.bb | 1 + 2 files changed, 55 insertions(+) create mode 100644 meta/recipes-core/glibc/glibc/0026-PR25847-10.patch diff --git a/meta/recipes-core/glibc/glibc/0026-PR25847-10.patch b/meta/recipes-core/glibc/glibc/0026-PR25847-10.patch new file mode 100644 index 0000000000..99049d468a --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0026-PR25847-10.patch @@ -0,0 +1,54 @@ +From 4f78382dd671f381db6d1f452e6f1593d17b177e Mon Sep 17 00:00:00 2001 +From: Florian Weimer +Date: Tue, 14 Oct 2025 06:53:40 -0700 +Subject: [PATCH] nptl: PTHREAD_COND_INITIALIZER compatibility with pre-2.41 + versions (bug 32786) + +The new initializer and struct layout does not initialize the +__g_signals field in the old struct layout before the change in +commit c36fc50781995e6758cae2b6927839d0157f213c ("nptl: Remove +g_refs from condition variables"). Bring back fields at the end +of struct __pthread_cond_s, so that they are again zero-initialized. + +The following commits have been cherry-picked from Glibc master branch: +Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 +commit: dbc5a50d12eff4cb3f782129029d04b8a76f58e7 + +Upstream-Status: Submitted +[https://sourceware.org/pipermail/libc-stable/2025-July/002282.html] + +Signed-off-by: Sunil Dora +--- + sysdeps/nptl/bits/thread-shared-types.h | 2 ++ + sysdeps/nptl/pthread.h | 2 +- + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/sysdeps/nptl/bits/thread-shared-types.h b/sysdeps/nptl/bits/thread-shared-types.h +index 6f17afa4..2354ea21 100644 +--- a/sysdeps/nptl/bits/thread-shared-types.h ++++ b/sysdeps/nptl/bits/thread-shared-types.h +@@ -99,6 +99,8 @@ struct __pthread_cond_s + unsigned int __g1_orig_size; + unsigned int __wrefs; + unsigned int __g_signals[2]; ++ unsigned int __unused_initialized_1; ++ unsigned int __unused_initialized_2; + }; + + typedef unsigned int __tss_t; +diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h +index bbb36540..8d6d24ff 100644 +--- a/sysdeps/nptl/pthread.h ++++ b/sysdeps/nptl/pthread.h +@@ -152,7 +152,7 @@ enum + + + /* Conditional variable handling. */ +-#define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, 0, 0, {0, 0} } } ++#define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, 0, 0, {0, 0}, 0, 0 } } + + + /* Cleanup buffers */ +-- +2.49.0 + diff --git a/meta/recipes-core/glibc/glibc_2.35.bb b/meta/recipes-core/glibc/glibc_2.35.bb index 26e8d8c408..1b5830699f 100644 --- a/meta/recipes-core/glibc/glibc_2.35.bb +++ b/meta/recipes-core/glibc/glibc_2.35.bb @@ -71,6 +71,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ file://0026-PR25847-7.patch \ file://0026-PR25847-8.patch \ file://0026-PR25847-9.patch \ + file://0026-PR25847-10.patch \ \ file://0001-Revert-Linux-Implement-a-useful-version-of-_startup_.patch \ file://0002-get_nscd_addresses-Fix-subscript-typos-BZ-29605.patch \