From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from YT6PR01CU002.outbound.protection.outlook.com (mail-canadacentralazon11022019.outbound.protection.outlook.com [52.101.189.19]) by sourceware.org (Postfix) with ESMTPS id C2C6F3858D35 for ; Wed, 13 Mar 2024 20:51:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C2C6F3858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C2C6F3858D35 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=52.101.189.19 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1710363082; cv=pass; b=mWeg/aGzTuMxGa2vcq6Dm6HaZzG+rhS7dFvuoQJh3VHpbyguMmVsZZrCfPZhUUKFSG75GRAmBGxYFG0KD+wgG4U3eLBUY1DCUBavkYy8eYEwMRts6/vur2OP3TB6tCvIe+IUz7q33XjB/h3IcgKwdpE+TGaH5286N4mggN+tUok= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1710363082; c=relaxed/simple; bh=vXRe9p8Jrh5ZTHWaBn2EmeSWItnzqrxAlC1l9Qvvq7s=; h=DKIM-Signature:Message-ID:Date:Subject:To:From:MIME-Version; b=ltMflA+tG0bpifIizxVVM1pUospF33GtMmwN4KTGIeCQ22+U4zzzKNmhR5Cu/tanSTMAK73WgXfbOstBkloi9uLVuySSfAOA0s7N2b54OfKmpf6EVsdxRTGmDFDQ4eq0/DWA2yh6yhHqjmwuD9qlXAtMCOkZI1yaYJqrcLHUIDk= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LXIqJmRah+1SeLxXtwyYvNhADReP5ai/RqMNUa5pzw0lDX89TaylF8yKmRouY0ymc34UQERFkgkvBenrdf4l4e48jnxFKEK6fQWD+ZPA17PhKCT+KZz21UXxdSc8yh+zW1Q/4LnvDgVjC73jHeC+zXMgI3k9DM5efZDAR5gSsTOEDICCE+5YIHe9x8b1o8XjHgPSNjElVLOEwkgr6di1TeQFNMA0IMDhhvNL8hSu6My0Y7W+GRj/FWagjji1rePtwtDK0mZ2Y2rC15h+11U40C9ZVRIRUvaIgGCnJ3WrW5wgib9747j80gh7Nft3RHdEGxriqTpLj3uzQOytfYJYzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=ADMv2KQof/4g0IFYFgSJNe3HsomDmvPo6e2809hv7sM=; b=V6KUk9WngKXYQoLvxtdoZ933mmTXZ83XFzAI9GxGZ4il4vPKl+3CqfI6HgBxxJYryLUFj/o9DaViQ9FXGr/pSBqMRuvMAElNtHqR8LKxaWRM0DZMBc4xVoixmULufpaOEyRoIv1Tzw74EAdTI3sP1KPSY7sva1YvX4c6f7I2XTQ+NOS5tbNsPI+nyabpiGRJyC/tfjsIaoVgPQPJprJukqvactFcCCO8fcftvW0Dt80jDgJgC7JvGtxe86RuDkVJxPGI2IMTr3rupp5Wc+RdwMYCqpj/ZCKswM8EEz1P3qwspU7gX2x/eKC2+9lQpSzcsKZlVWv7X4lSC2CYdUV0Hg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=efficios.com; dmarc=pass action=none header.from=efficios.com; dkim=pass header.d=efficios.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ADMv2KQof/4g0IFYFgSJNe3HsomDmvPo6e2809hv7sM=; b=aodype28gA01y5qG6WiCjRb3di2DXW2p4Aa2rNmBOp82VRJo7+W+C/urGv2flJO8EsmlkbJU0fOw/Xl/d/InLVt5a9FSC1wK6JEPBF07MkiQUxgTay+UOwQXlcbofo2oIqGvPBsT9W8dq50dAhYVjoOwhWMBxYygZ+UiLBtotWHljvn2eGyjqAVwiGNGq7y3WkC4vlmOqDID4W8n4Ja1Ct6bbFIleODMaYDnmUtGIN3ulWmt3jYY2R7jKk8sISEPSq++UVJvAlJDwf9/sN3iYjR0qIfRkCh57d0RTB+aFZzu9odrvofdzAmP5LAsaW5yWY9hwr66U5SnXLi+9XuARA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=efficios.com; Received: from YQBPR0101MB5080.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:24::5) by YQBPR0101MB4129.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:13::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.20; Wed, 13 Mar 2024 20:51:17 +0000 Received: from YQBPR0101MB5080.CANPRD01.PROD.OUTLOOK.COM ([fe80::9904:ce5d:438e:5652]) by YQBPR0101MB5080.CANPRD01.PROD.OUTLOOK.COM ([fe80::9904:ce5d:438e:5652%3]) with mapi id 15.20.7386.017; Wed, 13 Mar 2024 20:51:17 +0000 Message-ID: Date: Wed, 13 Mar 2024 16:51:15 -0400 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] linux: Use rseq area unconditionally in sched_getcpu (bug 31479) To: Florian Weimer , libc-alpha@sourceware.org References: <87y1amnd85.fsf@oldenburg.str.redhat.com> Content-Language: en-US From: Michael Jeanson In-Reply-To: <87y1amnd85.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: YQBPR01CA0140.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:1::40) To YQBPR0101MB5080.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:24::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: YQBPR0101MB5080:EE_|YQBPR0101MB4129:EE_ X-MS-Office365-Filtering-Correlation-Id: 26c8512c-382d-4063-ede0-08dc439f543a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XTddcXwOSsPNAUIut2gEIDziyyTkIgmX+eBROAuzVVMi9pxWTOZYKqB9DEE0sr0UktZLTRrbFjtnrVUuoAAwGv5pIR1F07nCyD0gYqzVTFOZzsjtkkYAnx8aKXAW07s4NfnnTinCLVYBSNuqwZ/qkVrCDbon/RDmwwz6vNxgUgtNt0RT758VCIP8knxa045WyHh915348iz3xiozMekrAk+SWeyfdXjy4ziuEaaHksHdZmb8L1pCRIqckpiATVgamwHVxQJQ9bsCNY6mPUryGWIVfaY4YfVuqkDlQRGCxFHw8f2EjAXxe/61SmwRawJxbJRdDCdYLS+XfrXrlXa+HILbcCiG/pttKrJQ5g9QTW2MxWe+uOufJ+hRP/ZCBw56yNXOeiPOrmddlIzoKMYUhAAilX/Anp5zG4l0GtRPdBr+NNKHO+Xp2igLKP0UblnN3NjfMS8/VqEALaDs1V+03WfrVoE07HYLHZaKEtGr+SJzOygxsrhez1kRzQkWI9LmB5lrh9KxJIQMxZLPNSphkNodN57YlB3d8pvWiTTtGyldrcoxzXEAG54D6QfwiDg53+PvuF8/DaOTYnOoj3jS7CdNEPguRZ3zO6Q41jyJT0TPqixzWJtW5x9mT/6z31Bmbhsk6u3C771RUCgf0cLLIw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:YQBPR0101MB5080.CANPRD01.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(376005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-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utf-8?B?M3VMcWpMa1E3STJES0cyRGRlQUdEMXJWK3M4YkFkSDBZN3pXSnRTb3lNNTUv?= =?utf-8?B?RS9sU1k0NW9ZRi94MnkyY2ZyYTRJaC82cGNOTWg0Wm1oQ2c3Sm1qRVdyc040?= =?utf-8?B?cEcxaVdQNkV0QTFOcnIwa0dSTEVRQ0svYUltanIrL05BWVcxSWw5UkdqUE5h?= =?utf-8?B?VVZ2bUlQamR2ME5TVmhVRVVpM1VqQ3NyTjJvZmFJMFl2Y2F2OVpWNnluVnhn?= =?utf-8?B?Q3k5NkFJTXZmbHEyb2JRTXFCV1RzbkZITE1zQnZ6UWVwdndVNWJSa1ZQSDYv?= =?utf-8?B?c0lRNStwQ2VEaHFNWmZpVFNCSm5EK0pRMTIvaFlSd2p1dmRQdDVvTW1QR0lS?= =?utf-8?B?cExBVmxVTWVIeFNMSW5iZ0toNWlVRTNCM3VvZTdxaXZGTEQ3NDFuTGRnZk9C?= =?utf-8?B?M2c9PQ==?= X-OriginatorOrg: efficios.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26c8512c-382d-4063-ede0-08dc439f543a X-MS-Exchange-CrossTenant-AuthSource: YQBPR0101MB5080.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2024 20:51:17.3018 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4f278736-4ab6-415c-957e-1f55336bd31e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wKN+9OyFRH/oT1aPeXFrMGBcPvn/NbuGsWsm5YdmzcraERnXaAsrR72QZTppxvgSLt/Hj74kmoojJuxeYWwtjQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YQBPR0101MB4129 X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2024-03-13 15:28, Florian Weimer wrote: > Originally, nptl/descr.h included , but we removed that > in commit 2c6b4b272e6b4d07303af25709051c3e96288f2d ("nptl: > Unconditionally use a 32-byte rseq area"). After that, it was > not ensured that the RSEQ_SIG macro was defined during sched_getcpu.c > compilation that provided a definition. This commit always checks > the rseq area for CPU number information before using the other > approaches. > > This adds an unnecessary (but well-predictable) branch on > architectures which do not define RSEQ_SIG, but its cost is small > compared to the system call. Most architectures that have vDSO > acceleration for getcpu also have rseq support. > > Fixes: 2c6b4b272e6b4d07303af25709051c3e96288f2d > Fixes: 1d350aa06091211863e41169729cee1bca39f72f Would adding back the '#include ' in nptl/descr.h have any adverse consequences? It would restore the original behavior without any effect on architectures which do not define RSEQ_SIG.