From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from PH7PR06CU001.outbound.protection.outlook.com (mail-westus3azon11010066.outbound.protection.outlook.com [52.101.201.66]) (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 5D5DF3612CF for ; Fri, 26 Jun 2026 03:57:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.201.66 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782446280; cv=fail; b=Lsp8GTqNrGwFU12/37+y8V7L4ugGJHVwa66c7lje4S7Gg/X8FaQUn9d8HjlBZBUv0YAnNmaWVAahiyboq4Z2ubOF080fYNmsmCzDSF9mNdMnxXKN9eomLzK88cBP7q+erW/janZV9kBc7XJw6sjF6y/K/CVACXUtDKEX1Nflpi4= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782446280; c=relaxed/simple; bh=8gT8wz0U2H6Ycm3NPzY+Vu1wvA+a5/xEf/2pHtZ5rhY=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=RVugnoyZrFj/FRFYKGopNHF8DUPmi+1HsCbFabPeLblBnZmHsltku4N85JZCFoprmgzZjmHogbZYge7WDaDLbteXNUtmKM+W8CHr/7wDViSt1t6fUEtcB6dbwE7sTRa8T4gx9BJvkP7vUItHGaKWj2NT5VALkHPMs0+U0pqXFFQ= 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=h+CVtQz7; arc=fail smtp.client-ip=52.101.201.66 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="h+CVtQz7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=I88Gl9ZSadupfovjv388ELKIMRVEgcwbZPGKMQ3TlypGnp5NSCHTrCzlnk+xeRBhwByhHluH8HHKP6JUgRNL1YB2e/D/vWSGQDCLIMSxx1WIuXOCQYnu0DIj2Jyhs+E6MztZng/oGNUDAz1aEHrEmAinqeAhfDmSZDDs8evWvqUMm2onV7oyrBrgvI/jJRnaZMorO05yYbxS8KAxq2gPMVWvGK+Cy1uREExRamYvfOk10NJoJQMtrAMOdUYeXSk5WjEvgj/z0+PDgJ6Za1vDmlUfeDAawJLeI0geAeKnI+FK08u/R2IniTnys2Bxed2+bA4PPbfkmz846t+RiJbMsg== 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=orrGCfbIzQIUQ+kU1tbp6rJbTYU3cTXFH5RRIivRr5Y=; b=dBNaBqykrE4fXfelSVxWgrovaPycy0EeExvwlLL5x/nFR0cvZXIQ+CtgvLWlAT5u+FmaryV2AS3TIEmW2/Hat9KE0LRTT6lWiGoQf2YQBIIMUKP33Bb4VISO7xOJwWzYTOzzu5wFyutZh5o5wxkZk6omcuIpgjKhPL+QB5l0+2TQ/mTPItkzDTKWCd+vJWairpC0yooc1ARPih3Rp6o1RBVQ2Gpf31rHR56NTanGqWxnOwEiywwnAFcusZ/X7sdVaxkDLTQFkNyUQ38srvMh30GH8+BbIyFySlOec222fPG5vcdPTj84EYvAMZRuh7itCs2MiYyb/HVNVtWDj62xNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=infradead.org 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=orrGCfbIzQIUQ+kU1tbp6rJbTYU3cTXFH5RRIivRr5Y=; b=h+CVtQz7sf57RbnIhOBtKaIHd/FCxRdwdkCBtBXaD6j5xictZQDV+mMoqsJVldxxAi06HUqnapOTqrZ9GX5FPwLtn4TkGrlX7GoN5ZENfan61F5fTbiN/2yU4UQMj3PUwI5EXeZmI8QRLO0B4BmSTvWXn1emf/EaG4XxNwjdsBQ= Received: from BY3PR04CA0021.namprd04.prod.outlook.com (2603:10b6:a03:217::26) by DM4PR12MB6589.namprd12.prod.outlook.com (2603:10b6:8:b4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.139.20; Fri, 26 Jun 2026 03:57:51 +0000 Received: from SJ5PEPF000001D7.namprd05.prod.outlook.com (2603:10b6:a03:217:cafe::62) by BY3PR04CA0021.outlook.office365.com (2603:10b6:a03:217::26) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.159.16 via Frontend Transport; Fri, 26 Jun 2026 03:57:51 +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 SJ5PEPF000001D7.mail.protection.outlook.com (10.167.242.59) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.6 via Frontend Transport; Fri, 26 Jun 2026 03:57:51 +0000 Received: from satlexmb07.amd.com (10.181.42.216) 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.41; Thu, 25 Jun 2026 22:57:50 -0500 Received: from [10.136.35.225] (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend Transport; Thu, 25 Jun 2026 22:57:47 -0500 Message-ID: <9a7608a5-d164-4b1c-93d9-6a7431b7a896@amd.com> Date: Fri, 26 Jun 2026 09:27:41 +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: [PATCH 6/6 v3] sched/eevdf: Speedup short slice task scheduling To: Peter Zijlstra , Vincent Guittot CC: , , , , , , , , References: <20260624151229.1710703-1-vincent.guittot@linaro.org> <20260624151229.1710703-7-vincent.guittot@linaro.org> <613c1bde-4152-493f-b103-f1fda035b4af@amd.com> <20260625083720.GR42921@noisy.programming.kicks-ass.net> <20260625100957.GA2568396@noisy.programming.kicks-ass.net> <20260625222843.GE1181229@noisy.programming.kicks-ass.net> Content-Language: en-US From: K Prateek Nayak In-Reply-To: <20260625222843.GE1181229@noisy.programming.kicks-ass.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001D7:EE_|DM4PR12MB6589:EE_ X-MS-Office365-Filtering-Correlation-Id: 2fc8e253-96a2-491b-c913-08ded33717fb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|36860700016|1800799024|7416014|82310400026|376014|22082099003|18002099003|56012099006|11063799006|4143699003; X-Microsoft-Antispam-Message-Info: BITthBFxNqMo7j/qR0kA8vKLotZwlJ55MMV1JH29X9fOoqCmIEdXFAJTLOE0bYduu4RpX6FL3K+6bTNtXsojdk/X07toXx+1OeyAzrDmgO2wLmPcbQ6YB0IkpwJ8oQfL5NvH992eZKR2abmgL2qMldsprjmSeNgMUESXnS2R53xcY6qhMSN05isOORf1tIJxUXP3w5QshNMcRBaHqRtH4qQm+SH0tr4a7grgKSONYvkWO2i7s7WPx0wrZhJr+wrutzOfoWsi4BgnS4P1O1u7ib/psLCsI1Ag+D4Cnh6Ub3V0v7RTdU3NVld6jN8O8gPgAHA42Ci76x0s59uJeJyIZy0ylA6MjYWcs5ZNnZwyYn3AoMxIrdco43Y61nBFXYJd9jp+QApwHVUR1tM+wKfE4elfnnQPl23Oqcq1NQ37F2dthVDrfFU7fkdVB1u/do2wUlTlv1d53HtCFpLk8peBx4FFJZCYmyY7r/iFKewispbF0Kk/kYSFQb3eCrOZxvXqwOJejy0X+T8e/jD2kQ/Aet5jSZvSzgDI+fuNXWATGb7PhiV4B/QIz8QDD4KrnLR9L3LGTY1HWwOjPaymDIsXvYPwOKlf+6mImw+ffDON930z56E8PZ0csk9D6RlHiDBiqbBCcAGecCWcX3Biswi5/va4gYjWdQGj0MsHhd3Iyt5CXrTLXLfUYmAmy7yKGOVQ/+D4DIy+qHBcICa4L0Gh1g== 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)(36860700016)(1800799024)(7416014)(82310400026)(376014)(22082099003)(18002099003)(56012099006)(11063799006)(4143699003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: B6hm94SmR0EV4oGlqyY5RTbmMZ6hsVX2BNOSHqfj6w0In5ggwWc+UkEk2EYRCKlfvFw7g0984lxrgkbzuHL/obOTJkQXWny1rUiBB1LUoA/aUZ+5Nci7wPGJaEBBI9VfcLlY454lodhBbM3yZ4Ux92P6n9woHUoJAD3cs3dCR2/G53cK7FT+2mtVfMp1IuSixvGAG9ipacf0I4QeXfmrs8rKMZ1VqZSO4sWhueiXrDfgjg63nTX4xf9hPxKeVU+Gb/nNyHVDk3/F2v5AmiN90LbESnZ903s++P5Xh4GQgpnPiqULSxSAOdTCTjZuhfw0JQXnbPQD6CGIuNJ/pFSDnaBffR84NhFO97W8JhYmnXWYsFd9zqdRSu92fAsdQJPnPSZIRbhc8T+FlNEtC7MzkplDTUG7eIk4AQ0u6INsYoMxKCVmMR0Oc/fg42WlHsT9 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2026 03:57:51.0881 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2fc8e253-96a2-491b-c913-08ded33717fb 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: SJ5PEPF000001D7.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6589 Hello Peter, On 6/26/2026 3:58 AM, Peter Zijlstra wrote: > +static u64 ineligible_vruntime(struct cfs_rq *cfs_rq) > +{ > + struct sched_entity *curr = cfs_rq->curr; > + long weight = cfs_rq->sum_weight; > + s64 delta = 0; > + > + if (curr && !curr->on_rq) > + curr = NULL; > + > + /* > + * This is called from set_next_task_fair(.first=true) / > + * set_protect_slice() so curr had better be set and on_rq. > + */ > + WARN_ON_ONCE(!curr); set_protect_slice() is indeed called from set_next_entity(.first=true) but it is done after __dequeue_entity() and before "cfs_rq->curr" is set (both sched/flat and sched/core have the same pattern). You should be hitting this splat very easily unless you have moved set_protect_slice() after the setting of cfs_rq->curr in your tree. > + > + if (weight) { > + s64 runtime = cfs_rq->sum_w_vruntime; > + > + /* > + * Do not add @curr to obtain the effective '- w_j' terms. > + */ > + > + /* sign flips effective floor / ceiling */ > + if (runtime < 0) > + runtime -= (weight - 1); > + > + delta = div64_long(runtime, weight); > + } > + > + return cfs_rq->zero_vruntime + delta + 1; > +} > + > static inline u64 cfs_rq_max_slice(struct cfs_rq *cfs_rq); > > /* > @@ -1058,8 +1119,14 @@ static inline void set_protect_slice(str > slice = cfs_rq_min_slice(cfs_rq); > > slice = min(slice, se->slice); > - if (slice != se->slice) > - vprot = min_vruntime(vprot, se->vruntime + calc_delta_fair(slice, se)); > + > + /* If there are shorter slices than se's one */ > + if (slice != se->slice) { I guess that condition was protecting a simple boot test but If I run: for i in 10000000 20000000 30000000 40000000 50000000; do sudo taskset -c 0 chrt -v -o -T $i 0 loop& # Simple while(1) loop done I see the splat: ------------[ cut here ]------------ !curr WARNING: kernel/sched/fair.c:858 at set_next_task_fair+0x1d1/0x870, CPU#0: kworker/0:5/3750 ... > + if (sched_feat(PREEMPT_SHORT)) > + vprot = min_vruntime(vprot, ineligible_vruntime(cfs_rq)); > + else > + vprot = min_vruntime(vprot, se->vruntime + calc_delta_fair(slice, se)); > + } > > se->vprot = vprot; > } -- Thanks and Regards, Prateek