From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from CH4PR04CU002.outbound.protection.outlook.com (mail-northcentralusazon11013022.outbound.protection.outlook.com [40.107.201.22]) (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 B0C4D3603C9 for ; Thu, 2 Jul 2026 04:56:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.201.22 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782968182; cv=fail; b=dZCtbe/5wzd+FQBPusOZ8MRTr2hVLPeInOGalKFgg4xtRRWJ/qAlGHJWz6l8jzfPw6sU03xkUPTFD+1LV9iENrDpaZzOfkN3FBL4a8jkbZWFhiz5HPovDdflm1MuSKbnw/ui8n3yUaaQ8cb32jmgDw9rpTo0k8IQWuJXJUsDS1o= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782968182; c=relaxed/simple; bh=Gwy0QZNrJI0UgoiVSIzmjClwH1VA5fKS5aArlFidhuM=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=Dzckg3kIQgP0Z7lKiBeuHiSAM8EYuHbjXtieZwUOQWkQuIs0+EuwuuwkFZc8Q2wM47e60ihCbqeX8D4Bxjbg44B0jDpf0FWBl0Vns2adK6gYpBIhz3caSZW9wVdi5JqRh1e5YDQpuRfKfhgzhUsdawM26N4kYI6eQxL6tvZF1Qg= 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=mM2mVhov; arc=fail smtp.client-ip=40.107.201.22 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="mM2mVhov" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JYIiJZBy6E/yodhxkljY7x3LZQ5HLUCjjB5TDA+RchxfO/iPAgqH/kVsu87iCXFOsCWPf6yG+8pZnki/MMM3WmPop+/Cz6zN80HsieQdoEqbqwWIZDnzLRhWHnvFxAy+VzckmdGWeLzdj4/qul5MQlr4+FLRJ5bmM6uOq0sr7gRAVUYZc2kbgWhu4XKnDjEW1Wo5G1EQnV5l5OveS6FIXZqwVTQmFfsgNTfo3KnPO3n9eXJHRpqHBYsjYNRNn81894KuTagednxvy223LGa2JUo7B2G1pgIjvy+Cq6SzLDT/1pMV+aZEeqczTIDio0eZZ/nblwLz+Vtn1YcINQuE6A== 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=XefowLv7hR/PEiNZlI+3Y63EitgyW+ftS9suyPDhX7o=; b=tfSGZf/zLC48F9WG1lkIz9K1nUBNZ4dT8SYq2JvtCgSuN3PfWAgWhhBTRL/vfCBd7fQ+YrqGDvRqQ5t5DSoC18mKrRBF7gcuXqVVkVHaE4oRsln1rZsM0Sk4kVerLq3FTrFIBVVYPptHztICYz1C18Qx4D35tcJoi5Q474elwc/8cFXJoDbLuQALeJCfK4onUmK0pltxyouK/7+SrQHHfl/U7IjqZ+DZiUu9tih9AdXvs14HxcZd7TOYsTjKuhSF24d8+L2Wo466398kGjos5fGlM4ivUxRaWZPnX5+MzQsKAq0rgeNlcwTNyOaIbX4c9TDgSLBj4fz0Tz4nR6bx2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linaro.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=XefowLv7hR/PEiNZlI+3Y63EitgyW+ftS9suyPDhX7o=; b=mM2mVhovn+QIOGITpVxocBL1TWD6rgoXRetka3lkzk6RWCIASWxlM7g7amKOKvkzkiDtzmTKPlMvFNgclhHVrAvyQPeYye3/y6nnwbreas3ueXTfrnqjc0TKCMj3Eh6MWB8njBazGEZ3Gua57AM8KdzAMkVT4ZT0xnHDOSsfv4o= Received: from SN7PR04CA0097.namprd04.prod.outlook.com (2603:10b6:806:122::12) by SA1PR12MB7152.namprd12.prod.outlook.com (2603:10b6:806:2b2::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Thu, 2 Jul 2026 04:56:14 +0000 Received: from SN1PEPF0002636D.namprd02.prod.outlook.com (2603:10b6:806:122:cafe::5a) by SN7PR04CA0097.outlook.office365.com (2603:10b6:806:122::12) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.181.9 via Frontend Transport; Thu, 2 Jul 2026 04:56:13 +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 SN1PEPF0002636D.mail.protection.outlook.com (10.167.241.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.6 via Frontend Transport; Thu, 2 Jul 2026 04:56:13 +0000 Received: from Satlexmb09.amd.com (10.181.42.218) 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; Wed, 1 Jul 2026 23:56:13 -0500 Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb09.amd.com (10.181.42.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 1 Jul 2026 21:56:13 -0700 Received: from [172.31.184.125] (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend Transport; Wed, 1 Jul 2026 23:56:09 -0500 Message-ID: <8d2a006c-4157-40af-b33f-fb45f708555d@amd.com> Date: Thu, 2 Jul 2026 10:26:08 +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] sched/eevdf: Delayed dequeue task can't preempt To: Vincent Guittot , , , , , , , , , , References: <20260701164920.1571352-1-vincent.guittot@linaro.org> Content-Language: en-US From: K Prateek Nayak In-Reply-To: <20260701164920.1571352-1-vincent.guittot@linaro.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002636D:EE_|SA1PR12MB7152:EE_ X-MS-Office365-Filtering-Correlation-Id: 52c57399-7c43-4184-0665-08ded7f63e32 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|36860700016|7416014|376014|23010399003|11063799006|56012099006|18002099003|22082099003|921020; X-Microsoft-Antispam-Message-Info: NYZutCCc5jbFacF4YThC2vYBQL+fGFmUBlEXlbYzLg2MoIMPaEkzbVbGOUQnvq1RZVO0R4N7oyOX5ZRVApapUMlts9TxMtM0ElhZaG7/X47scKRASpp97wTkNLOocecC/twtHznWnwiVHTfDOkbHDA1bipXBjaSLw8FwKDnoXIk5BBWYT9vWbkr6ek0BEsPhPSbHnS5tgsCJp4wpqucXTLsF12CcqfNG8ELY/Bbvq9KTb+u8LWZJzVfljGcG5jwW/Fxevcp7ABrVWJNXg0xcxFid2k200vsD4ABLvir8oMr37asGRF3BIIvul/namOtwtHdoEN1wm5S7iTVfkfbjx6w/QJXbK2nXS1Xiun6xDeo5ZE8SuZyoTy2ptgNN8Njf/UxCfgE7pHW4Mr+mopBf+3WUcD6Md2TTjrAH/T5zjyaoLMTHqHm0b+TyJ3OU4DlRgip+2LQIDDaSp3HPd0Dw+PFdC6Ht4MtHAs+rhve7rI94iB0EOh+rRGnc9vIwfEz74+pWcLUnstBjZUaoEM5Nh6CeQwwjnX/cwa/zb9eRg43h6eTvu5+xLkv7Mr+lCUFDejB3cvOwF24b/mGkhM7pYc61DIj8RExkedOq4RWaKFKED8PiKLpql2VoVC+myNQWBQZEjtTE8XZiLzvr2nH1LbbdSdxkL2XhqduxdEvrBuksNe0KN2W0DWfj1x5tmjpw5CSAahnOGuni+PvfjNie+OfL5T8LTMIsyymrTUPfQL/FnoINmgxJUBQnLJXsibm/ 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)(1800799024)(82310400026)(36860700016)(7416014)(376014)(23010399003)(11063799006)(56012099006)(18002099003)(22082099003)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gYjbzaHoGe4tFwasUMy/SAGvjYco4rzwzn4O6RUL8zaBWB7K5ly9jC5+PXY2IAXoBNrgp7ee2HHg18UOyL3U/OMY6ROwTEqRdgX0Nib9XIOjxMx1Iscr5fE7F79gNJeNffm/Ypaa3xakCXjUm4z5gMWfXP+NjU62/y08S9duRmxQVqedub4d2liERm2lnqcgWDI2YFdET63cSxGTFUp1Xk8HXLOfIAK8rwyN038An/rtxXmy05+tESUSUNKwP6CYs00RC9G5Cf14yxlqMWHWyqlp39P5srhHvnRYxG0GF26tKSGhG/offNp/hGwRm6aklTGdM/yyQBD4kESiNGaTP5B3iUkfoLpZOOsQ3tP/i9OVBvLz/AwQAstwduEoJGNbRlb+fRZrIJaay2f7DLZA7t77UKhCU5JRdXVqRV5t2TIYN2Mha7RFk/LLT1wK2APA X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2026 04:56:13.7964 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 52c57399-7c43-4184-0665-08ded7f63e32 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: SN1PEPF0002636D.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7152 Hello Vincent, On 7/1/2026 10:19 PM, Vincent Guittot wrote: > Load balancing can migrate delayed dequeue tasks to even the load between > CPUs. > > sched_balance_rq() > -> detach_task() > -> deactivate_task(DEQUEUE_NOCLOCK) > -> set_task_cpu(dst_cpu) > > -> attach_task() > -> activate_task(ENQUEUE_NOCLOCK) > -> wakeup_preempt() > > A delayed task with shorter slice can be dequeued during pick_next_entity() > but then jump to preempt because eligible. > > Always jump to update for delayed dequeue task even with shorter slice. > > Fixes: ba0d3bf5f97b ("sched/eevdf: Cancel slice protection if short slice task is eligible") > Reported-by: K Prateek Nayak > Signed-off-by: Vincent Guittot Thank you for fixing this! Feel free to include: Reviewed-by: K Prateek Nayak Tested-by: K Prateek Nayak > --- > kernel/sched/fair.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index fc6cd55f9d22..df8c9c2c7918 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -9948,6 +9948,13 @@ static void wakeup_preempt_fair(struct rq *rq, struct task_struct *p, int wake_f > if (unlikely(!normal_policy(p->policy))) > goto update; > > + /* > + * Do not preempt for tasks that are sched_delayed as it would violate > + * EEVDF to forcibly queue an ineligible task. > + */ > + if (pse->sched_delayed) > + goto update; > + Small question: Are we updating the protect slice just to maintain the lag bounds with delayed entities? Otherwise, it might be okay to return early here and keep the current running for a bit longer and wait until the delayed entity gets a wakeup which does a wakeup_preempt(). /me goes and checks My hackbench run says: Test: vanilla early_return 1-groups: 4.75 (0.00 pct) 4.46 ( 6.10 pct) 2-groups: 4.52 (0.00 pct) 4.57 (-1.10 pct) 4-groups: 4.67 (0.00 pct) 4.73 (-1.28 pct) 8-groups: 7.09 (0.00 pct) 6.85 ( 3.38 pct) 16-groups: 12.07 (0.00 pct) 12.03 ( 0.33 pct) but there is enough variance in the improved runs that it could all be noise so your patch should be good as is. -- Thanks and Regards, Prateek