From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from CO1PR03CU002.outbound.protection.outlook.com (mail-westus2azon11010054.outbound.protection.outlook.com [52.101.46.54]) (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 1B87B302742 for ; Thu, 25 Jun 2026 06:00:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.46.54 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782367261; cv=fail; b=kjnSyBTal4LXj5M/BEglAIqRIpH/tRKTNsB2vLFuMppj+49trmFtsfEQSnVCYlPJIjnnhZ/4Ur/0VcA01YFCqZpi37f3vqb/Fe/Xr//w252bWcD4MgcmqbLETqeT1liN0HTTxvGNVI1Kd9t089v+SIXXfIMCQAgwcodJR4VBouM= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782367261; c=relaxed/simple; bh=6uTC50Ba61+ObkJbdI2QpgZc3ae5FAZvD6rDJQYEznY=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=WR+103erlS4FTZOLjgiFSuL3SeA6tAu1RtWUj+v7OpL6cgWvTV8mxK4RhqpepOtdqTzsJel8boFCcUnNqxcFbiszV38MN7LS/IYLnCyHTl84nRVicOuQOho6XR8Fd2Yf/VWi9Tv8eWA6WEPFBtd8WjuSnJ412H97r81vwCLAX78= 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=KUIuvNc7; arc=fail smtp.client-ip=52.101.46.54 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="KUIuvNc7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Nl478FNnCYBrssS/Ob6BUfC5fWCRZs1JAFnXQlZzRYMM0i/qV5MzVnCaqkhvRYDc+LActyHjBZeFC6XhAR3GzzZFVnmKSfV7vMK6cx7E6lRIe/UgpD8r0VACgzdXV9ZNte2ldStyhi6JzWAw+C3QXMO07dca8mB8AK+9oOkFCAJ2ItrKjTY/CSOJuRFf2z1q0RzMTRnuOnSonbMHPjxXgJfRV2D6IARXfODws6nSkuNBH6Op2za5A40J25lN86M1avrlpJpMydfHEOHHu9jsfVJpfyUQORyWwnrseKCWdPeSXB2CxMx714T/yzEfBWLWdxTO9IW0TDQHIrKiNUH8Vg== 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=p/+lbw/zlCJR3vn1ZBbhDbJO2U9TBFRXMEDZK3O289I=; b=FfQKuKkiH2kqSq7F9e5W8PwnglGOxVnmN/+J58CIMyqs0j/WcvtTI7JI7KrS4GQI5ODqnlTBjvSB/umwdo9ea067WqxH7PiUP39EVgifQMrybl+TwgQIFoDbgUnrPImYZgkkDaEPxb8m4E3rZIRd2+qYtJaAj9Fo7ShQ4det4RK2fELb1K6KAq4OjMyILlU8v95eoMWfGWGPNdHlqeULxU+KylwHE8rE+T0HGmIqByvlcnc2EenF+NauVQOmU6bSts2jVMOhDEKFIysvORVPrqmTk+CB5DhrdZFrRQrXj+4KhWht9/FMlYgEa24EcHnomH1Hejr05SaxxG1KAK8KmA== 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=p/+lbw/zlCJR3vn1ZBbhDbJO2U9TBFRXMEDZK3O289I=; b=KUIuvNc7UxTWkoVaFkt+o0PpncAY/LgQk+eOn3kvunvgRVxTEVDtaWvuyiKixl817RuVDgRSZId52gTS1MzDdM1PFSvrPfUOwTb0/ieL/U1UDH9NA9VpH2Dl9fJHLbSha/TcZvjkDVpboz5kFb9qOj0KAX/AM7n/UFivWd/7rLE= Received: from SN7PR04CA0012.namprd04.prod.outlook.com (2603:10b6:806:f2::17) by SA1PR12MB7174.namprd12.prod.outlook.com (2603:10b6:806:2b1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.16; Thu, 25 Jun 2026 06:00:55 +0000 Received: from SA2PEPF00003F65.namprd04.prod.outlook.com (2603:10b6:806:f2:cafe::8c) by SN7PR04CA0012.outlook.office365.com (2603:10b6:806:f2::17) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.159.15 via Frontend Transport; Thu, 25 Jun 2026 06:00:55 +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 SA2PEPF00003F65.mail.protection.outlook.com (10.167.248.40) 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, 25 Jun 2026 06:00:54 +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; Thu, 25 Jun 2026 01:00:54 -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, 24 Jun 2026 23:00:54 -0700 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 01:00:51 -0500 Message-ID: Date: Thu, 25 Jun 2026 11:30:50 +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 4/6 v3] sched/eevdf: Cancel slice protection if short slice task is eligible To: Vincent Guittot , , , , , , , , , , References: <20260624151229.1710703-1-vincent.guittot@linaro.org> <20260624151229.1710703-5-vincent.guittot@linaro.org> Content-Language: en-US From: K Prateek Nayak In-Reply-To: <20260624151229.1710703-5-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: SA2PEPF00003F65:EE_|SA1PR12MB7174:EE_ X-MS-Office365-Filtering-Correlation-Id: 68dc093c-93ef-46ba-525e-08ded27f1eac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700016|82310400026|23010399003|7416014|376014|1800799024|56012099006|11063799006|4143699003|22082099003|18002099003|921020; X-Microsoft-Antispam-Message-Info: UkcIQSdrPCGzZQ3ozppSFb1NcCU2IzrNXYTeDUq/+4V6QLDd4dMpREBTQq6e37zdQznhjG9QPHYRygpmmTmlkhmLWj4wqWmcCHLxA0hq/cljAc2R7I2GuHxzN3JPE0L9dkvvzR8xx2mMRcmrnZf9dLWyVPVCrNxRvyepAbYHHXJZzeocZLDFpI9wjxkRWjwuMZeUYlzYDqCSZhZPvgtTfFDGLlifbzVCq1DoZSBNzVh6gZLRdAgO96Q6lQ15ICsylwQUOY9Wck1HkmoOunQqudMBwm+G21NO6nmz/QF1j69ZPH/q37LB4TwV+QlnUNAt/yHrtYgTaKxgdh0ORSvBxz6trGhGG1fVtRo6aa+bx/V7BvH99ltKrLz7JMW2t8bYd7DK4Ak9hojU4SnDMtRP3sQrvc2sy+pDhWkCakWF92xZnwe5NeivioXYx2LkPbi5eqS7Tbrtp7DR2iYWH30lAGfLRUFf6bkPwHKUo84Zjzxtm3LPm+iSynBxo7kjAtycAeTeM1GodxYgCVcIUd5KTezbNo6Iu64xHy9Zw0FOxFPNBKCZL7O2uXmU6F1mVeqdWAMvbCRTbrxnB7TrdysR6xFIvzTocGDsGkrjedCWGx9xDOMRTcmd43nDg0UaT+XB9NNxapxRQmuuuDKRtndvk+XhHDbArh6PGK+2sY5Zd2M2Rv/Y9faep4IAm1reF48OwQgXm3t54YdoeqTQmwmVJHos9KKhDBTS9AgxowiK99O6RNNaZYvQFxDAULIPqNAl 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)(36860700016)(82310400026)(23010399003)(7416014)(376014)(1800799024)(56012099006)(11063799006)(4143699003)(22082099003)(18002099003)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xnwtb8hb7Y9W34pxO+pY1JRQq1xYZHPoYwmvW3deqX1DEHWBAt2rOD6nd670bSrL0nBUZ0X8wOM8EFkJe8woCVONpv3239pHbfZ9hWxtMZvRKrCUG6Na6vaOBJomIqnYucub2p0NQxACyLgnn/zFSrTG5XoVHCaq+McFmdZakIXW9yNsChFtMDbdd4w6y1BUf5zdjbMeitxED2cjRIzjeQrqzqMJ2ncZJ4TykrVgij/5atz+uBXjDgRxTeN8bzYZNYL3aa87ldODh2rqIQFK6ihM+5VNHZ4XSWRNcE8l0KcuNARCq8yKqQmLelwT6b72eLTjIqWOMqtqflJQOLmOA3ZUEigZ6wFObb9L4JMBzvKJm3l5Q+HqugEgOX3Npr2oqU08sA5zHx/2Q0PRtRY1oiycwR1ttrrqWQZjyh+uqhLPv1hq1vMigBlKW8t0kxeU X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2026 06:00:54.9844 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 68dc093c-93ef-46ba-525e-08ded27f1eac 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: SA2PEPF00003F65.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7174 Hello Vincent, On 6/24/2026 8:42 PM, Vincent Guittot wrote: > @@ -9896,16 +9891,23 @@ static void wakeup_preempt_fair(struct rq *rq, struct task_struct *p, int wake_f > if (!nse && cfs_rq->nr_queued) > goto pick; > > + /* > + * If @p is eligible but not the next task to run then cancel protection > + * to prevent large scheduling latency > + */ > + if (preempt_action == PREEMPT_WAKEUP_SHORT && entity_eligible(cfs_rq, pse)) > + goto preempt; We handle "pse->slice < se->slice" case before "pse->sched_delayed" case and jump to "pick", but pse can get dequeued as a part of pick_next_entity() if it was delayed and picked. I think we can reach here for PREEMPT_WAKEUP_SHORT after pse is completely dequeued from cfs_rq. If p is a task on root cfs_rq, we could have blocked the task entirely and ideally it shouldn't be referenced here. Since a wakeup of delayed entity / on delayed hierarchy will call wakeup_preempt() anyways, I think we should return early if we should directly jump to update if we see "pse->sched_delayed". > + > if (sched_feat(RUN_TO_PARITY)) > update_protect_slice(cfs_rq, se); > > return; > > preempt: > - if (preempt_action == PREEMPT_WAKEUP_SHORT) { > - cancel_protect_slice(se); > + cancel_protect_slice(se); > + > + if (preempt_action == PREEMPT_WAKEUP_SHORT && nse == pse) > set_next_buddy(&p->se); > - } > > resched_curr_lazy(rq); > } -- Thanks and Regards, Prateek