From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from SN4PR2101CU001.outbound.protection.outlook.com (mail-southcentralusazon11012035.outbound.protection.outlook.com [40.93.195.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4473833EB06 for ; Tue, 11 Aug 2026 03:55:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.195.35 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786420522; cv=fail; b=mPAIEh4lBfEPemqGTIKnLbqa9urZgQ48lIZRwLSZEqmg3mnJgB4uKP+Soil2dbqCcSRJEZZiZqM3sL+wA7ocGIRzSYktb8sUU9F+F3/kut4d7FB98NBYrQiFJbvQOadHZE4TOj/GWTvD8CExvLxyQGU10tL/xCgFTKPepmb0Kgg= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786420522; c=relaxed/simple; bh=fhpMO+RTRSWLW1A6wkmQ3td0XRXlJcvTt+BM201wghM=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=Ijnarj/rX9H1caFSUhVUuZh/usCxvOoSa3uXWZlJlSKJZpSthDegfTvEVMoMsX9F1BQjH9nF7vTCeASmzSqyCffYsomfP8KL2l+DU0oMOBZ7D31uF5TwXc9LCKq3bcufUZhRzzhODAiOVhmWJcNfEsk9aoOq3LTI8gUOdggx/9I= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=4p/7JaPv; arc=fail smtp.client-ip=40.93.195.35 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) header.d=amd.com header.i=@amd.com header.b="4p/7JaPv" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zJaQg0VaOFHbtZ0Ymux2ZFGcr7oRpsY2Roy7LHp1NmbYbJu6VnWA5ig+s+uAXCxIlck2LTaosVyWyBRLriBPrx38HosB0VTw4ncAQp+wknZJx2jQeBQUxvgKJkbjKj+fW1HWzWfbJNt4GKwOGTTl53GQ96htgtGkygMxXYw4PUwP+h5zusi7tYITM2aRH49qHAMcRLAW7aGR4MLdfNeRnK6koKY+Vvwng0B7DJo57/qXoFEbDfZEwxQ6R+64f2lOTOTCVb5ISDY7CRe/GOFoWUezActp5NViytmWMxVts3ygwy3o2s8U3UR1PyA+MwOiAaYJG4WNCT6ckk0o/VXGJw== 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=RCiOoFAUj8lxGo2iEO6baXZ8OOTowYuELPfg4Fu3cps=; b=RtgSn7VNcmjMirw99T/QXZKLW8GMycO7uRsWKUZiWDDLt7i5pdfOHrulDRuGKZenOS4rFtJlCkXDwpqD2GAABQXaOWT6zhEKWMbESRkvy9fCghsDCjLKKRFJ8enzWOMrCsvodsPImUEjcPiLUD5JY8TkA4N6vo7yq5U4CoP9nwd2uTftQCCIu6oLWJc+GKQCDz52tb2Z/saQqRYml+p7u27U7jFn71AubqOMhxa2GhmklnTYjtm84oFqcqcYemBDQLVns2iQTyoVg80WPRmJdemRE9kmimZvq+0lNr5UV1Ids9V6mNLYJEbFQZ5AoEdOn0+zUPmExxduhd3LSR9OJw== 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=RCiOoFAUj8lxGo2iEO6baXZ8OOTowYuELPfg4Fu3cps=; b=4p/7JaPvmnSThBLZKOD9YAcpnmmDB40KSFhjEO9iT4a9cidG73Ye/RtsOS3DaTy50PzLt/bAogQli0uD/fZaNcsob7rqUVhU3vWJJ24BFYP0njfJmY9RyJEUVRYDhMlA02Ajlg3iaEd3ARbdZZdKjaaud4MgeRi+VDLsB2cSZMc= Received: from PH0P220CA0008.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:d3::8) by CY8PR12MB8298.namprd12.prod.outlook.com (2603:10b6:930:7c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.315.11; Tue, 11 Aug 2026 03:55:16 +0000 Received: from SN1PEPF0002529E.namprd05.prod.outlook.com (2603:10b6:510:d3:cafe::6) by PH0P220CA0008.outlook.office365.com (2603:10b6:510:d3::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.292.25 via Frontend Transport; Tue, 11 Aug 2026 03:55:15 +0000 X-MS-Exchange-Authentication-Results: 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=satlexmb08.amd.com; pr=C Received: from satlexmb08.amd.com (165.204.84.17) by SN1PEPF0002529E.mail.protection.outlook.com (10.167.242.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.315.6 via Frontend Transport; Tue, 11 Aug 2026 03:55:15 +0000 Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Mon, 10 Aug 2026 22:55:10 -0500 Received: from [10.136.45.191] (10.180.168.240) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.45 via Frontend Transport; Mon, 10 Aug 2026 22:55:04 -0500 Message-ID: <76bf6fb3-2406-4a01-a37d-1626ef34ae18@amd.com> Date: Tue, 11 Aug 2026 09:25:03 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RESEND][PATCH v31 1/9] sched/deadline: Ignore proxy-exec sched_yield() To: John Stultz , Peter Zijlstra CC: LKML , Christian Loehle , Juri Lelli , Joel Fernandes , Qais Yousef , Ingo Molnar , Vincent Guittot , Dietmar Eggemann , Valentin Schneider , Steven Rostedt , Ben Segall , Zimuzo Ezeozue , Will Deacon , Waiman Long , Boqun Feng , "Paul E. McKenney" , Metin Kaya , Xuewen Yan , Thomas Gleixner , Daniel Lezcano , Suleiman Souhlal , Andrea Righi , kuyo chang , hupu , References: <20260807035232.1881495-1-jstultz@google.com> <20260807035232.1881495-2-jstultz@google.com> <20260810155603.GY776954@noisy.programming.kicks-ass.net> Content-Language: en-US From: K Prateek Nayak In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002529E:EE_|CY8PR12MB8298:EE_ X-MS-Office365-Filtering-Correlation-Id: d31ca0bb-c871-4fb6-9d97-08def75c5a21 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|376014|7416014|36860700016|1800799024|82310400026|6133799003|10067099003|4143699003|5023799004|56012099006|11063799006|22082099003|18002099003|3023799007; X-Microsoft-Antispam-Message-Info: yivDEKY21ZZwOoIHSrUo3tLpmjO+Et6ZqrudK2wyxRFYu1Y/6DsguXdMIa0y5jmQvuL/5QJKE65Rui77YZeG2NsRXfNGD8zY/o73m6R755ohpRlRJPWzInbEKJQi30WZscv1JkrreKRrwN9kddL3euf23dkitHFVhIpvyuXAhXtj0uGK1nm+IYp7+Mhg5P9djulrTqjZa1mWXV6hJBCyqtaTC6hV1K+gXGu4wngu1hqepFJ9ZWMiiepYGjWZAQHebfwPCtXdx1J8MnslblNFg3oeSXHNuT1cC+KwIIcfqh1oE29JoJRMYeGmOVG4+fij5jtgN1xpw6WrBy50Qzz4mufC+M5Poz8KZTjVDRQkXzj9Tn64ckJ5HHD4lu1MIjK4xfembpQapUeyxlg6SOeLlzyFcrJ3IKuExm4JJ4w3a6N/Iex8yCiQgkMp+qY+uz3CrBClBtkXc1cgaa4/YVkGDny5/RSDlco9HbZtmI/tr545j3zoqJSNKpvQO+JBQ9mgUrSiqeQot+n1CeQq+N6cim5vvHmKjhzdjp25iDi/rGD4wyknXnTngMTHv72eMyhXystlGMUcR2+K8Ewqp2L/8ToWBMdyIQxiMe5AVx1bATwMH38iXhArvJhGP+ahDtQCZvA9mpCsaMH6KMp5jfZldT9UGcVolfwC6+jkIVaEfaG8TcJRpEuy4GTNMPpo4xEdH5oYj662vxOfr/yaQp5Y1Q== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(376014)(7416014)(36860700016)(1800799024)(82310400026)(6133799003)(10067099003)(4143699003)(5023799004)(56012099006)(11063799006)(22082099003)(18002099003)(3023799007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3ZjrJSmKnZzj94y8xES3sPJmPQEjnPIWgbtibgzawjhUNb0Fe0fLiTP+DZGvavY/sKvMO/8Cy5B4vliy3QWLQSdUMWHntywibsLtxnDGpa1w16w34u77GPqUeSe/64z25MKXcc0sBl7y1dtOXH64iUh8qfq0kt9IpNb2hGHn+CTjNnAM6oK7TwWlvgVBvEouFeVUqQyq+BKnV87CWO7a0Oid51/FsXHjXgGTZyAzx7/8YTH+/Bo0WYlTZPdzhxDaB9H/G0jzf+LYZn+4KIhpF6vy8zF1Uyh8kXz/c5atpkgQBTxDIQYwlZ8ZqMmKJ/cGT6cuc6yr/9OVlqoza9zAekytTRHDws+iEjjPPfMlwB3EdhDnsDArjpa0ylXMtzGCL+XawddS+7BvvqHUNo4XbWLx/noxUKQuw4wvcCaIfH96IwKtDRZ4jtsNqtaChkui X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2026 03:55:15.4001 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d31ca0bb-c871-4fb6-9d97-08def75c5a21 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=[satlexmb08.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002529E.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8298 Hello John, Peter, On 8/11/2026 12:55 AM, John Stultz wrote: > On Mon, Aug 10, 2026 at 8:57 AM Peter Zijlstra wrote: >> On Fri, Aug 07, 2026 at 03:52:07AM +0000, John Stultz wrote: >>> From: Christian Loehle >>> >>> With proxy execution, rq->curr is the execution context while rq->donor is >>> the donating context. rq->curr's sched_yield() is dispatched through >>> the donor class so that proxy execution follows the effective scheduling >>> context. >>> >>> For SCHED_DEADLINE, this is too strong. yield_task_dl() does not just ask >>> for another task of equal priority to get to run, it marks the current DL >>> entity as yielded and forces it to sleep until replenishment. These >>> yield semantics are fundamentally different from FIFO/RR (where if no >>> equal-priority tasks are runnable, no harm done, they get picked again >>> immediately) or OTHER (also doesn't cause priority inversion), so do not >>> mix these semantics by ignoring a sched_yield() on DL donors. >>> >>> Fixes: 127b90315ca0 ("sched/proxy: Yield the donor task") >>> Acked-by: Juri Lelli >>> Signed-off-by: Christian Loehle >>> Signed-off-by: John Stultz >> >>> --- >>> kernel/sched/deadline.c | 3 +++ >>> 1 file changed, 3 insertions(+) >>> >>> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c >>> index 0f858b98c9aa3..3e89b3abeb278 100644 >>> --- a/kernel/sched/deadline.c >>> +++ b/kernel/sched/deadline.c >>> @@ -2574,6 +2574,9 @@ static bool dequeue_task_dl(struct rq *rq, struct task_struct *p, int flags) >>> */ >>> static void yield_task_dl(struct rq *rq) >>> { >>> + if (sched_proxy_exec() && rq->curr != rq->donor) >>> + return; >>> + >>> /* >>> * We make the task go to sleep until its current deadline by >>> * forcing its runtime to zero. This way, update_curr_dl() stops >> >> I am not sure... >> >> Yes, we should not yield the donor. However, completely ignoring the >> yield() is also wrong. >> >> Now, the only way to actually hit this is by doing yield() while being a >> lock owner. And arguably that is quite insane. But still, completely >> ignoring it sounds wrong too. > > Ok. I'll drop this out of my current submission series. > >> >> Can't we 'queue' the yield and have it be effective the moment the donor >> goes away? Question: What does rt_mutex do in this case? >From my limited understanding, for rt_mutex, we hit the is_dl_boosted(dl_se) condition in the throttle label in update_curr_dl_se() and then we do a: enqueue_task_dl(rq, dl_task_of(dl_se), ENQUEUE_REPLENISH); Would same work for proxy too where we can essentially consider "dl_task(donor) && rq->donor != rq->curr" as is_dl_boosted() and continue with the "boost overrides the throttle" rule? P.S. I dropped this patch and added the following on top of this series on top of tip:sched/core and nothing has crashed (yet): diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index a3003b0f4522..797cb316fcd1 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -101,7 +101,11 @@ static inline struct sched_dl_entity *pi_of(struct sched_dl_entity *dl_se) static inline bool is_dl_boosted(struct sched_dl_entity *dl_se) { - return false; + struct dl_rq *dl_rq = dl_rq_of_se(dl_se); + struct rq *rq = rq_of_dl_rq(dl_rq); + + return sched_proxy_exec() && rq->donor != rq->curr && dl_task_of(dl_se) == rq->donor; + } #endif /* !CONFIG_RT_MUTEXES */ --- I used AI to generate a module that spawns 100 threads (50 SCHED_DEADLINE, 50 SCHED_OTHER) that does 100000 iterations of yield() in a mutex critical section and I haven't seen any splats from deadline.c yet. I do see the deadline threads on the CPU when inspecting /sys/kernel/debug/sched/debug and things are finishing much faster than sched_proxy_exec=0 case so I'm assuming it is working similar to the rt_mutex :-) -- Thanks and Regards, Prateek