From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.46.127 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796062664; b=KKYEvt4QrswsY2Y0IMapCg4a6Oop8nu+e9cKA5sopY9XtVrtGLuX3rvNX0zN/PwThVnz Ws9OmNdc3MCYEOC8ZSssgteaaOXeSnzFmi8tSPCM47fUtkDOWs6CvFpXhO0AsHBSLex3q ELFnszZErXasYOAYY7AYfRySnOhF2pbVVi4etwFdhT77ShVN9HD8dkHd0yYUKYHUD2utl XFNq9kGuCUszSRh8kaBbq8bPvBuGEkXusoy9kmahHPOm26Ybk7u6E9/5iPGFRWrrQ3UPl wMHktHWG8sDcfSS0obqAMbScYKpghBgB01FBhBzh5yS7ZOoqHah0f4OQi7b1CLLnjjw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796062664; h=DMARC-Filter:DKIM-Signature:Received:Received:From:To:CC:Subject: Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To: Accept-Language:Content-Language:X-MS-Has-Attach:X-MS-TNEF-Correlator: msip_labels:x-ms-publictraffictype:x-ms-traffictypediagnostic: x-ms-office365-filtering-correlation-id:x-ms-exchange-senderadcheck: x-ms-exchange-antispam-relay:x-microsoft-antispam: x-microsoft-antispam-message-info:x-forefront-antispam-report: x-ms-exchange-antispam-messagedata-chunkcount: x-ms-exchange-antispam-messagedata-0:Content-Type: Content-Transfer-Encoding:MIME-Version:X-OriginatorOrg: X-MS-Exchange-CrossTenant-AuthAs:X-MS-Exchange-CrossTenant-AuthSource: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=U3hFIYqmXutjI3Tx+Niw/iKKOYj15gSS0ELLLpOl9go=; b=Uz3dwi8GCBrv/CeTqP6qnUiugUdk25iY93C3Vyu13r4UzpfKgHcdCl9l0vz6UfKhrGU9 nIcB579hX2pjHsgjGpfUctV6u1+MMZtrE38AL4aQnhhB4Pu22A3zw+TcAs434UUZOejw8 JekHRh8vCBIg3jfeJXTtAjHk1F8ophqdbQBmpnn99ualbczm5TEqrgSX0CEal6Icn3W1y SzkJ+CfNzMzWHLuPM74zBNoL5XjkkRIZGkREnEIoiGrdOdXvnZ5ubLJQxfMBdgyFFTG2i 8avA7/40r4F5p9IPIzXt7GjYuE3KSEvux9/szXO/PohMrNiqoNmgQYJ8H3F6Jyj+ZEw== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=vt.edu; spf=pass smtp.mailfrom=vt.edu; dkim=pass header.d=VirginiaTech.onmicrosoft.com header.i=@VirginiaTech.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-VirginiaTech-onmicrosoft-com header.b=fmSBGXRf; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.46.127 Received: from CO1PR03CU002.outbound.protection.outlook.com (mail-westus2azon11020127.outbound.protection.outlook.com [52.101.46.127]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 46305606A31C; Mon, 30 Nov 2026 18:17:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 46305606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=vt.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vt.edu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=VirginiaTech.onmicrosoft.com header.i=@VirginiaTech.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-VirginiaTech-onmicrosoft-com header.b=fmSBGXRf ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=M9D3b43bZpaYjsgS7ffa3K14stpJJUeEHMXEryHmNtCrSZonRUPSUbXzkYm+xkDfgvs2k+5Vz2tjd0dFoEPjwcRQqGk5noXSXzqyCEsY9I0osNyycFR7TiXfiibHg1tiJmVrJ2eAQPiaThSGVhqfqvL1wy1lFty7/rZU8vqaAicBsB5e4z55rB6KYTPcLjCpz87ZtK6JEclMVAQEK7TwXUhy6BLtjU+mrJLsyLXCI3B3py785GVkdW1Eu0IFqXIZS3J5fck0mIMhZhilsMN/5zFxZIvIQoht2htpffI7BhyGJkDqzp5xjtVmJzI5ZsbzdcCwbmKxNj6iz91/QZWLiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:MIME-Version; bh=U3hFIYqmXutjI3Tx+Niw/iKKOYj15gSS0ELLLpOl9go=; b=ht+LLIEBpLgdKDAA7iccgstlNj9JySh4U8FwPKYLKU8KyHvHMipCCcEg6A49b9X6kEo8gVp0KGodL+TNx2oG8oZ6a74/sfejUys0ZWvtSmSpvh/LLCdKRLb8njhU7kWBJ0vPXKwBwPVl9KKRlZlu+PDMT6irZfaeS2SxHggVeMSqy3sUK5hnCGjQPXtEfJUqgaDv2kniIrJZyMSX7toNwKOSwxj/YaYMqseJ1uPv1GuLuM9EU9m9mmh6wkgxNbguK4YEjzhOBCw/3USEbjx038aTWYL4LDtdnf6JM3+1WoLH0WXu3q5YqCjcETQmBaEUDiotBMeqdSRsxUBBHKs2fA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vt.edu; dmarc=pass action=none header.from=vt.edu; dkim=pass header.d=vt.edu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=VirginiaTech.onmicrosoft.com; s=selector1-VirginiaTech-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U3hFIYqmXutjI3Tx+Niw/iKKOYj15gSS0ELLLpOl9go=; b=fmSBGXRfi5s2naF5+4j/r9FK6Mb/DBXBKB+L4xO542NgvcsH/iAJPfnF8c3H4NOvVTlcuXoARLRWIu7hdF8c6+S19SuISFoRQO48XzNm4zlDHvdCtYcaJAgX10DfRUDP/JI3lakxT+7H3nMvGGdlUcAeGu4rjAVfDT7pNsHKTOw= Received: from DM6PR05MB4137.namprd05.prod.outlook.com (2603:10b6:5:81::28) by IA3PR05MB537251.namprd05.prod.outlook.com (2603:10b6:208:549::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.12; Mon, 30 Nov 2026 18:17:41 +0000 Received: from DM6PR05MB4137.namprd05.prod.outlook.com ([fe80::a6db:3b91:d780:cd9b]) by DM6PR05MB4137.namprd05.prod.outlook.com ([fe80::a6db:3b91:d780:cd9b%5]) with mapi id 15.21.0662.007; Mon, 30 Nov 2026 18:17:41 +0000 From: "Ravindran, Binoy" To: "paulmck@kernel.org" CC: Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Josh Poimboeuf , Miroslav Benes , Petr Mladek , Joe Lawrence , Song Liu , Ingo Molnar , Jiri Kosina , "rcu@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "live-patching@vger.kernel.org" , Yafang Shao , "Shastri, Jaidev" Subject: Re: [PATCH v4 1/3] rcu-tasks: Add helpers to visit tasks on the exit lists Thread-Topic: [PATCH v4 1/3] rcu-tasks: Add helpers to visit tasks on the exit lists Thread-Index: AQHdfcUQnIWlHKLdE0+Y6XoN8dKWBLdG6O8AgAAHtTY= Date: Mon, 30 Nov 2026 18:17:41 +0000 Message-ID: References: <20261126-klp-series-v3-v4-0-2ad73e9c9254@vt.edu> <20261126-klp-series-v3-v4-1-2ad73e9c9254@vt.edu> <9c5f9c77-95f9-4850-9355-13e9ac0ba6d4@paulmck-laptop> In-Reply-To: <9c5f9c77-95f9-4850-9355-13e9ac0ba6d4@paulmck-laptop> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vt.edu; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM6PR05MB4137:EE_|IA3PR05MB537251:EE_ x-ms-office365-filtering-correlation-id: b3b3597a-6560-4b34-8c3b-08df4f0e38d4 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|7416014|366016|1800799024|786006|376014|23010399003|10070799003|38070700021|261102123227099003|10067099003|56012099006|261026140227099003|261026121527099003|261022105027099003|261028144727099003|261021121427099003|261021123027099003|261009223027099003|18002099003|22082099003|5023799004|11063799006|4143699003|6133799003; x-microsoft-antispam-message-info: EG1h+EvZQY5zn81uZQcQuTONVtpsGMf2rq7ZFutfcjaV5mQISd+AqxiqjBr8DVURaZ0oQxLNXZWUVARqbNaC/0ae5Fu5yZN/yy357WHvddnCxwpBh8A0jS7oRM0GpzQkLOShdeed9arGXHeYhu+3SUDNb6cy6Cw2RiuQQ5IWmvwSQnSZhtCoFpPAI6gpUtdhWf+dLOL2LPOvDP/r90z7uLS0Ivqp9aIDolRZbIqKE2ggHVixDITJ7FwWrfHLVGRmzJ0BdJ3pq15G/TpaWYJGGZbMrUEr54n/57sHV9bmXDuewUz0LyN79rMRYs0BAFLQptncP17pTKPR+6hNxAkUyMxrQJMSjAIpgEU3ze36biOkqwtGojqzTapJ5yFaLVc4XJ60NpkQDR+Z9vnmG5FOTDUB5oNafLU35dty+EFMmhOKDc/lWBNh5tJTxpI77CRy6VHeJrIiwAw1/nZZ+br3lzBTgVrVxnB7QJ9Jnkw3rfvqhF8TgvycYeH7F+6hmZJukb78EeeF+z8YurVKfUMRTyf9iWNG6vb9wioA375l+ItuGDWMRmQGMhtGNq2VUEutKQlxpFTID68Rnv+8die26jssPSG3qqBasCOgDZZaZqktQBtDxk6EOc6N5dim8MrWaKIejp20/QTCFvalVcR/u/+r1G5T2ejmfSSYfvAANqDzNpI+REzrpuf/HlQHHgLPPRxUfyMPUu2dg1qkcYW0T7xcDohpkIz4HBgVzY8NbUY= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR05MB4137.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(366016)(1800799024)(786006)(376014)(23010399003)(10070799003)(38070700021)(261102123227099003)(10067099003)(56012099006)(261026140227099003)(261026121527099003)(261022105027099003)(261028144727099003)(261021121427099003)(261021123027099003)(261009223027099003)(18002099003)(22082099003)(5023799004)(11063799006)(4143699003)(6133799003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?Oa54ZiZUeysymB5a1Tz8BSePPk2H9Rcy0RwQQGQHw5XgBVSWIFQlVEf5Wf?= =?iso-8859-1?Q?PuUcVGeR/ywyI0TdJY5WRWokOKfESAy6HByKOwfaueHwmK+emz5wcQBmON?= =?iso-8859-1?Q?qwF9idKumHsRuQqiSExw4M84CVXIXWprFcBgr0mK3LtVuxm69uLZBpQv3C?= =?iso-8859-1?Q?+UktYNEKfqaBQtnWUH3kkp+aQx+bN+zOorYSkrkMWIUJsrzY9ywqvw+VrH?= =?iso-8859-1?Q?07YrNPGhVYJiL7m25Vm6iwew2lAADYrMw7QzSnTOTDcD4a31rKRtUYlPNc?= =?iso-8859-1?Q?7oi2E2zWRfZNMbjZ125ZyVV20EitL7/ZVoFFDY/JUY3pAE8cd4T77+0rY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hLWYSO19gK0fj4PoYW006jqETp?= =?iso-8859-1?Q?3V9CcxbPX3WVV7J5y3aKQI7oPd928AkSqXH0OboctcbQW74r9C/4Ktyg87?= =?iso-8859-1?Q?KvzcxuzrRJPsoW19it8pcY09FCOPfc25dK08ViRzi0X2M1hnRzqz9f2XHS?= =?iso-8859-1?Q?cIL2mVXebkuhGpUr0g3PvAKpKfSJtp+dNMm1bMPVcxH8OgMPmADE9RgxyS?= =?iso-8859-1?Q?yLvd2FEPeeRblnatAeLfHe13/jTN8DMvL/eco71Sbw6jAq6CuHZkzqg2t2?= =?iso-8859-1?Q?KF4Y/uuxejEwPqtNANqQxMHP3/Bp4GuiC6vUi/2Q80R/3mxzgGcmVnC7ja?= =?iso-8859-1?Q?S/ARJ2WWgOYKIFKIq5n/jPyj9UasBMh4JgNMBKGbjDwhtpEHOM8ngYQ5fB?= =?iso-8859-1?Q?LGXe2kTekOOIeXRSGAR8zosM9prnmvREwEc5Wn9tn9lQgTxCUFzGu/ath/?= =?iso-8859-1?Q?8UX/CSk+9hr8wwY23R8E2kKsJ4CWk0GkO7bsC+1mVDl0TKhkw45uNlLx+y?= =?iso-8859-1?Q?z/dTCyEOhZj48jwbr0C0PiaeZFwLnVgucHBm46IkXmaErJ?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-OriginatorOrg: vt.edu X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR05MB4137.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3b3597a-6560-4b34-8c3b-08df4f0e38d4 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Nov 2026 18:17:41.1341 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 60956884-10ad-40fa-863d-4f32c1e3a37a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: l/CxYISO2Z+TprFvHxndewPSAwPLQU5geZ7id5mUz6AKlWg1jfA85tT/SUbJxfO+ X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA3PR05MB537251 =0A= On Mon, Nov 30, 2026, Paul E. McKenney wrote:=0A= > OK, I will bite...=0A= >=0A= > Why not simply invoke synchronize_rcu_tasks(), after which any of the=0A= > tasks that were missed will have already exited?=0A= =0A= That was our first attempt, and it is not enough, for two reasons.=0A= =0A= First, the task we miss can be in a quiescent state as far as RCU Tasks=0A= is concerned. It is sleeping voluntarily in do_exit() after=0A= exit_notify(), with a return address into the old patch's code on its=0A= stack. A voluntary context switch is an RCU Tasks quiescent state, and=0A= check_holdout_task() drops a holdout as soon as its nvcsw has changed,=0A= so the grace period can end while the task is still asleep there. When=0A= it wakes, it returns into freed text. With synchronize_rcu_tasks()=0A= before the free of the replaced patch and a 2 s sleep injected after=0A= exit_notify(), 5 of 6 runs still crashed.=0A= =0A= Second, the problem is not only the free. The transition must not=0A= switch a task while one of its frames is in a function being patched.=0A= The invisible task is never checked, so klp_try_complete_transition()=0A= can finish while the task still runs the old function, and the=0A= consistency model is broken whether or not anything is freed. A wait=0A= at free cannot repair that, since it runs after the transition has=0A= already completed.=0A= =0A= So the transition itself has to see these tasks and check their=0A= stacks, which is what the rest of this series does. In v5, which I=0A= plan to post this week, the two helpers in this patch are replaced by=0A= a single walk of the exit lists that can drop the list lock, using the=0A= same cursor scheme as rcu_tasks_postscan(). If you would prefer a=0A= different interface on the RCU side, I am happy to rework it.=0A= =0A= Thanks,=0A= Binoy=0A= =0A=