Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=40.93.194.69 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796197320; b=21WDBMk6dxqFa4mSoAc528fRIn+Vph2MxhHRwyCkGW+3f3dCoFKqF8J6aBKbjRqYFP7Z 04ERP6R4YE6z3mVHFGdfYsKBcADacvv3iJiE57YyNM3ebRVM5oUz6wzrGRFikqmc8661p czJRvequ1ua8bcimb0xVZv+4B9HnTxzcSiR85wFqs9b3kA4XehsBhQFGriRtrFLlBY9fS DtSYyzas3FxYWIM4zB9cjgtBu0nULGu77IsVmolsSrpw7NjlUC6CLRAAEFo9huREL5crL 5BSzMwTGhCnVHX/JaR0bAt32ph4Jg44WwhT277gz8tI4vEGFxL2mLU7flRKD287ZOKA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796197320; h=DMARC-Filter:DKIM-Signature:Received:Received: X-MS-Exchange-Authentication-Results:Received-SPF:Received:Received: Received:Message-ID:Date:MIME-Version:User-Agent:Subject:To:CC: References:Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:X-EOPAttributedMessage: 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:X-OriginatorOrg: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=rbD7SKSkKGVG1tjLhw8pUb5UScSixTbsMZ5/YsG6Cf8=; b=BkbQuqotzNMCnzIu7gQupwTR3bpLxgKC/J6foKb3mJ/oVz+1ftvOGqpq9GOEa3Ur1mlx EsYktfFsMhUwYq9joaIFZkNbxOJV+xhygi5Aa5uyH7cmo7YZj4vbeWHGII9bW72G947D0 1PCDOiKkK5se7AfHuuOGXv3SS7cnFloBYlX0Kf9ZCv1ByL+5HYk/va76AuEpBE1xrrhFj 8Pzo7ukoVhqub71DBWrSGzHT+tBc9UnXY4mUWJIEYtWpfgnZt4LhheTC+XlahD/fy+YKO rq/x4pA7Cp0HkLD727mLl6X1SS+I7nOa0r6vYZiGTBxRiWd0dkFaGD8ePhHczhKTTYQ== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=W4DtoLGM; arc=pass header.oldest-pass=0 smtp.remote-ip=40.93.194.69 Received: from SN4PR0501CU005.outbound.protection.outlook.com (mail-southcentralusazon11011069.outbound.protection.outlook.com [40.93.194.69]) (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 ED540606A325 for ; Wed, 2 Dec 2026 07:41:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org ED540606A325 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=W4DtoLGM ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tZuo5jX7r2ccqdRg27TJzaQg56A7s7bTD8MCgb6NVm5a0DeX8Fp8N84NaVit82dHJcUvDrJ3gwOgRIpvcoMZoyPgqro6AislyR8c2iY3KuTe41tIW8zMDIBflX4PGRIXPs3V3ikD14mAzS8mV9NaIfiSBERZ98HaQ/PsY0naXTu2RVMU0ZTcEMCvOyJgZ4Cc65ImrftzkS+udXOjac/XPaKA7gSiUz8xtkZthr4fyg9LQagFSyeMNwfHcZrfVq+c4WkoMiU9nrXlodGIYV5SwX58RUK8eipOovrM3kn6e+hURJt9ivoU41X3lcm8/4TqXJiW1dZkZrLRQ3HNB5imow== 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=rbD7SKSkKGVG1tjLhw8pUb5UScSixTbsMZ5/YsG6Cf8=; b=Yi8OLubvgI/gZc9rIuXry1Htqy+wsszcW06ug3SBjI7yKQKQ6zW4vg5MdyHFDFew1NGGYbad4+1NA/5t3sj0hYhq2tSF7ZavEmmO9AA0JzjpwoqjRWKQsPgdoypOr6DON5aAvuoxGmd+0SZqibZojTrs56E6gpm2zSUBIfMjtadqQp2v6VUm7DokAwch27oUF9jFbHOg3wmt20HEL8JOKnwMKwdhScLopt+ByXvdzlOLADuoJe9yK5LKBmTwcwz6mOFepHnObs2qm/iq/XoUR1oTfd/uYhgMAysSG0HMwpKrNF4iNsx/GQV1frg7/9joioJrq+EVBohCJSSJBD87uA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=google.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rbD7SKSkKGVG1tjLhw8pUb5UScSixTbsMZ5/YsG6Cf8=; b=W4DtoLGMdiMevIpEl2t3Vmtl/TydNC1qcDpIR+nZdNKgQ3J4EMtNPdyhTp2K0UbhjQ1pDIPaQEbnJ8DiY0qEDxG+WMfzYp3y2TBDDdBRRWDiOVpqgINhAcvYQ7sMg8xELeEHKOkwksN4/HOS138+9nGlY8b++EEs9i9Fy1REggM= Received: from BN3PR12CA0004.namprd12.prod.outlook.com (2603:10b6:408:2af::14) by SN7PR12MB6983.namprd12.prod.outlook.com (2603:10b6:806:261::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Wed, 2 Dec 2026 07:41:55 +0000 Received: from BN1PEPF0001854B.namprd05.prod.outlook.com (2603:10b6:408:2af:cafe::7e) by BN3PR12CA0004.outlook.office365.com (2603:10b6:408:2af::14) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.11 via Frontend Transport; Wed, 2 Dec 2026 07:41:55 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by BN1PEPF0001854B.mail.protection.outlook.com (10.167.248.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Wed, 2 Dec 2026 07:41:55 +0000 Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Wed, 2 Dec 2026 01:41:55 -0600 Received: from [10.136.42.27] (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.57 via Frontend Transport; Wed, 2 Dec 2026 01:41:48 -0600 Message-ID: Date: Wed, 2 Dec 2026 13:11:47 +0530 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 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v34 13/14] rcu-tasks: Treat proxy-exec blocked tasks as voluntary sleeps To: John Stultz , LKML CC: Yu-Che Cheng , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Juri Lelli , Vincent Guittot , Valentin Schneider , Suleiman Souhlal , Andrea Righi , Johannes Weiner , Metin Kaya , Dietmar Eggemann , Steven Rostedt , Zimuzo Ezeozue , Waiman Long , Boqun Feng , "Paul E. McKenney" , Joel Fernandes , Qais Yousef , Xuewen Yan , kuyo chang , hupu , Zhan Xusheng , "zhidao su (Xiaomi)" , Hui Su , "Shubhang Kaushik (Ampere)" , References: <20261202035248.1210026-1-jstultz@google.com> <20261202035248.1210026-14-jstultz@google.com> Content-Language: en-US From: K Prateek Nayak In-Reply-To: <20261202035248.1210026-14-jstultz@google.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF0001854B:EE_|SN7PR12MB6983:EE_ X-MS-Office365-Filtering-Correlation-Id: d3a95174-a4c1-4a36-8bba-08df5047bd20 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700016|23010399003|1800799024|376014|82310400026|7416014|18002099003|22082099003|10067099003|56012099006|261102123227099003|261026140227099003|261026121527099003|261028144727099003|261021123027099003|261021121427099003|261022075727099003|261022105027099003|4143699003|5023799004|11063799006|6133799003|3023799007; X-Microsoft-Antispam-Message-Info: 0HtsynuM+4R82IzTLZ03hDbNTBFfE49LAqBTuFMyubu6Pzh3fYveCFe0PfJWWBDm+a8q3bxboA2J38Fz7/VvWbD0bYsLLoT89fzSs2dPXUcgc7vw3e/bBEOjUY7/StSXFZGhREVMyd+XFp5MXVZFpr+u1XagqIX2CTrwzeCkLiZ5p5A2wNSgtBk3qz7yfD8zi4OOKLQoLaD9aBDGOWzI8EuqWJczMDST0HF3ht5poZHqyirRuzkKVqz3UNuJzTZFmJNdQ5bt54MB8OcjimdM7PGjFW7OXGmZRq8KyPq0ujCd61Q74IvarT2q5RZA5lsH5ROVsmV3ioa7c1Nge3CGyqskrddn0B9EebzJUv+pWWD3a6RZE0t5da9Pqzyem8eMiJbyxyumzTLQFxGiLD869UVUGg9BY1a67r7tpTZ17T15kkamQ76+L5VvKPgkD5nCCHtu2IIjU4bsefHKiaLanaOEyMHX+cPi3LR5rfMOT4GCotxt0e9m99VCY4BuNWES8YoottrC6njnzLi4CwSq8/+Ot2lRfrLpGpCMHY4YoVtzVqv9bj2PlNSo/8ZrHAaXXT0uD9zKv5+2Ia2QTqv1bmoNL3gxZ5OZT1F9yISrhJz3dH0KRSKqDcnWI2pMd94/JYSReuACjl+ky0Yjkg+H4dVHQdBA/2Pqn12vYoMBqBJQqMm7n6Yuw7BafmbyIz6L14YU0aKOV0OZ4CcEG9a8Jg== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(23010399003)(1800799024)(376014)(82310400026)(7416014)(18002099003)(22082099003)(10067099003)(56012099006)(261102123227099003)(261026140227099003)(261026121527099003)(261028144727099003)(261021123027099003)(261021121427099003)(261022075727099003)(261022105027099003)(4143699003)(5023799004)(11063799006)(6133799003)(3023799007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FB3oAyezbTM8EdDWgo6QbUbInpYxDVBBye630OtnuLzHZ1SvvXTONScK/iDn86Ihajp963UajGMPH90gh87eYwUlTV0GdQ7lWoaz8ybobs3H+TK5wVzJ8sHOTPEUwxhHSiyZvxlK61IFTTTP0o8g0Rn5NYGr8s+dsbpUMQ1UXfMEYK93W95x1hG2W/RgeoggEqqUSe1chiJxir8MCl9j8fyTzpfDhuJjnF8q8nO2jsZPrQ3CATuKSp96og1sGpnx/Qcf85K7Wltt0gsgqXDlA/FuBkLjpo2E7fpmR+6Ecb9vZRPkZwG3NE8sh+BLWYWPEcUk4Seq97gXzNWm2DZGjNM2PxYAkC5tEPeh3XwVnxQmG68B1xS9n8AbKQF/aLslA137+RaSTIgBDUFdOtBwGVtTNWm+emzyxv2cq/DtaTkArgiHrvRZ/iCyEIO9KFHe X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2026 07:41:55.5389 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d3a95174-a4c1-4a36-8bba-08df5047bd20 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN1PEPF0001854B.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6983 Hello John, On 12/2/2026 9:22 AM, John Stultz wrote: > diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h > index 743f777b4c18f..e8fb33f853012 100644 > --- a/kernel/rcu/tasks.h > +++ b/kernel/rcu/tasks.h > @@ -920,8 +920,9 @@ static void rcu_tasks_wait_gp(struct rcu_tasks *rtp) > // > // rcu_tasks_pregp_step(): > // Invokes synchronize_rcu() in order to wait for all in-flight > -// t->on_rq and t->nvcsw transitions to complete. This works because > -// all such transitions are carried out with interrupts disabled. > +// t->on_rq, t->is_blocked, and t->nvcsw transitions to complete. > +// This works because all such transitions are carried out with > +// interrupts disabled. > // rcu_tasks_pertask(), invoked on every non-idle task: > // For every runnable non-idle task other than the current one, use > // get_task_struct() to pin down that task, snapshot that task's > @@ -940,10 +941,10 @@ static void rcu_tasks_wait_gp(struct rcu_tasks *rtp) > // corresponding task is removed from the holdout list. > // rcu_tasks_postgp(): > // Invokes synchronize_rcu() in order to ensure that all prior > -// t->on_rq and t->nvcsw transitions are seen by all CPUs and tasks > -// to have happened before the end of this RCU Tasks grace period. > -// Again, this works because all such transitions are carried out > -// with interrupts disabled. > +// t->on_rq, t->is_blocked, and t->nvcsw transitions are seen by all > +// CPUs and tasks to have happened before the end of this RCU Tasks > +// grace period. Again, this works because all such transitions are > +// carried out with interrupts disabled. > // > // For each exiting task, the exit_tasks_rcu_start() and > // exit_tasks_rcu_finish() functions add and remove, respectively, the > @@ -961,9 +962,9 @@ static void rcu_tasks_wait_gp(struct rcu_tasks *rtp) > static void rcu_tasks_pregp_step(struct list_head *hop) > { > /* > - * Wait for all pre-existing t->on_rq and t->nvcsw transitions > - * to complete. Invoking synchronize_rcu() suffices because all > - * these transitions occur with interrupts disabled. Without this > + * Wait for all pre-existing t->on_rq, t->is_blocked, and t->nvcsw > + * transitions to complete. Invoking synchronize_rcu() suffices because > + * all these transitions occur with interrupts disabled. Without this > * synchronize_rcu(), a read-side critical section that started > * before the grace period might be incorrectly seen as having > * started after the grace period. > @@ -991,8 +992,22 @@ static bool rcu_tasks_is_holdout(struct task_struct *t) > * traditional blocked state or get woken up without outside > * dependencies), not considering it such should only affect timing. > * > - * Be conservative for now and not include it. > + * So if proxy execution is not enabled, be conservative for now > + * and not include it. > + * > + * If proxy execution is enabled, lock blocked tasks may remain on > + * the runqueue, which could confuse this logic, making it seem to > + * be a holdout. So use is_blocked to detect this case. > + * > + * However, is_blocked also is set for DELAY_DEQUEUE, so with proxy > + * execution we *do* consider sched_delayed tasks to be quiescent > + * > + * In both cases, the is_blocked task voluntarily slept and has not > + * run since, so it cannot be within an RCU-tasks read-side critical > + * section. > */ > + if (sched_proxy_exec() && READ_ONCE(t->is_blocked)) > + return false; I think you can now replace the !p->on_rq check above with p->is_blocked directly - tasks going to sleep would have already cleared the holdout via: __schedule(SM_NONE) rcu_note_context_switch() rcu_tasks_qs() rcu_tasks_classic_qs() WRITE_ONCE((t)->rcu_tasks_holdout, false); for the current GP. The p->on_rq gets set and p->is_blocked is cleared in the same IRQ disabled section so it should be equivalent. P.S. rcu_note_context_switch() is done outside the rq_lock() so a task can clear its holdout and a concurrent ttwu_runnable() can win the rq_lock and wake it up before __schedule() grabs the rq_lock and tries to block the task. I don't know if there is any dependency on rest of the wakeup path for se->sched_delayed to be considered special. Peter, can you confirm if it is alright to just look at p->is_blocked for GP holdouts. Other than that, feel free to include: Reviewed-by: K Prateek Nayak -- Thanks and Regards, Prateek