From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from SA9PR02CU001.outbound.protection.outlook.com (mail-southcentralusazon11013012.outbound.protection.outlook.com [40.93.196.12]) (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 502943D1CC0 for ; Tue, 16 Jun 2026 05:34:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.196.12 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781588062; cv=fail; b=M6O7BElyghEjHibSTGIObSnFQ6i1C8kfK6dElAIXrVdoIxjr6QqrOFVzR0vE6ajvOGqIpiZtiAwwKNKDGrmW3kLTbeXCknxls0QV9gi/MpsxnD84m2Ks2c55UHR+Rapli9jzYC713L3wgTGkgU6SjdsMdZOZ5VrXbg/ClsJHJbs= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781588062; c=relaxed/simple; bh=6FciXIz4XtpS71hYqAMpoujYldLtgZ5NapzebExIWGs=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=jvBoh0fiePevbfYtMZx3IFT2vNYDDMn8vjQNU5Nj/ESBE1Ju8cLQ1PCtv81rTWhhJpRXZ75WKnIRhAQ5QODOjCoI709Xojkx8oihYidu6L7Z/MXRaB01KtuwcLqgzEyHCEqxeLiTIq/pqcZ56KvwmRZX6U2v3+vHXrGwyebmKoc= 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=UOYOQr5U; arc=fail smtp.client-ip=40.93.196.12 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="UOYOQr5U" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=J5KRUltCoONrACzRInzi/wUn0U8l1rGce9dr0wPjXJJ8J7CJZ2vheyZ1d3XXYugEEtWU2oWSbnmnFSLULQbdn1zI8JQOlGHoHNL04fjzPY6dzMaxIIzbdJcrmlYqZrUmXHoingF1WsENlzrm1xcIR2b2p0cyv3LdFZkG8Z3Wk8EBs359sNoecFvHpX4jFZk8WhAEnkVC+mt32z3CmmwsNf3bBndIa2ILMEgYxfuIgpgtphNcEXhpeaUO6C1vJFsQC8yLSnhy+MnfYmk4ZhLALqxSSFHYGC/RL6NQOUb12am+MBwh7Floh2DkSUQF0zJSg9qNwOypgNtbaOzRQ6BxDw== 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=PmFtfXQyxy7wBB0YWnqViF6YSS3zqRkWy9UbmzEcHZE=; b=HFXlUuMLMzoqJP85q7fgqqt5Q5ChfH+ldqJAMB3OHsNR8UivbuvJh4G9x+nrHM2gaoTZFTFMvMWJswQWvRY79XHCI7DPOOYafaH8JjOfiRI2QB9KBqp6tVaPZD8qsexe2eCcvrnnhRhaf7ciqqntqeGkOGXtnmuZ8P/Rxl+O5XGatp0w1kdChMgjuKKBtd1cP2UyB39n0rko0bOMKobTLKS247xANhfp+EKjkJzUjZ0LI7e0I4Yhh32aCjV6Co08cf4mVJVswv6Uok5Z8nWyJxfWKrlQ/REYGtaotq8HaEuTjXAoLdyJKXOqDhncPR9ugvK5nDxUTEhutpErhluPug== 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=PmFtfXQyxy7wBB0YWnqViF6YSS3zqRkWy9UbmzEcHZE=; b=UOYOQr5UymecbD39PIU8WQj8SZM/FgS32JiHsMySWOv5aXP7b2fxHyCQK9dTAryjctV/uLCVARYLQQEdoUmzpWWP4ILHl909pOeFWeKQ32/WWkYBGcU760krPzoAzUaoMG3ioW7nTEwChZdKUqIRpqPx4KuCA6Cr2K8lv4A2baU= Received: from CY5PR19CA0006.namprd19.prod.outlook.com (2603:10b6:930:15::29) by DS0PR12MB8454.namprd12.prod.outlook.com (2603:10b6:8:15e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.113.18; Tue, 16 Jun 2026 05:34:15 +0000 Received: from CY4PEPF0000FCC4.namprd03.prod.outlook.com (2603:10b6:930:15:cafe::1) by CY5PR19CA0006.outlook.office365.com (2603:10b6:930:15::29) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.113.18 via Frontend Transport; Tue, 16 Jun 2026 05:34: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=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by CY4PEPF0000FCC4.mail.protection.outlook.com (10.167.242.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.139.8 via Frontend Transport; Tue, 16 Jun 2026 05:34:15 +0000 Received: from satlexmb08.amd.com (10.181.42.217) 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.41; Tue, 16 Jun 2026 00:34:14 -0500 Received: from [10.136.46.240] (10.180.168.240) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend Transport; Tue, 16 Jun 2026 00:34:09 -0500 Message-ID: <83a0e2d1-379e-46ad-8068-9a016260d082@amd.com> Date: Tue, 16 Jun 2026 11:04: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 4/6 v2] sched/eevdf: Cancel slice protection if short slice task is eligible To: Vincent Guittot , , , , , , , , , , References: <20260615162420.420957-1-vincent.guittot@linaro.org> <20260615162420.420957-5-vincent.guittot@linaro.org> Content-Language: en-US From: K Prateek Nayak In-Reply-To: <20260615162420.420957-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: CY4PEPF0000FCC4:EE_|DS0PR12MB8454:EE_ X-MS-Office365-Filtering-Correlation-Id: f7eb6377-19b5-4b04-da79-08decb68e77c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|36860700016|7416014|23010399003|376014|22082099003|18002099003|921020|56012099006|4143699003|11063799006; X-Microsoft-Antispam-Message-Info: qcE2a9u73BLkJY1kK31k9HzQF0Is+Mt41NkKUAp1EBCrKzzP/GP9skdAZYG2tDaPVAQv+GKD6DZ85D9mXMPYdqrjhw9MokFubl2JODHOOk/wc48PFeR8cVnbv+xTxu86H1VjeSv2/M6b39wVoo1jFERN6EkbLVS+fMALhtuZ5yA1RZ4JKoJaIrFyzjNxhEoRU4vQJ0HqCXHFiB3gFy8U4RmAJ77n1Z3PHlMVdqhdFXDc1HUujet6RZVIIhVX+5JGvQQDibu1lwwYLSiz52rnrl7j53ndlTJjnHvIfFQSQO6LwDq6iiGuB3ULARpgXvqGwOCFIbe+6TEHaoCV0Ie84f9DSzS/0diZmvYerMQhvjOI/R5Wj5t3rcy3fxSSfteh6LmNwbgFSNbG21QGvbFpNwOmZ1LzO46NNtxUFUHIrdNft3nX/a9vx51277lD5ZgMCzPhUpH1qm6qlTsb6nXDIaAs0GwMGjBxbLvJ+CIt3EpcDn49LNiGP10HlT7eBal4VH9TTihkkHbMvBhDQi2ESG5mnVss6kPdOo7iffGQwM7uJL4nU5M3gDbwqJ62yoYwAWEU+Ga/UlBVHXk7G+XXjQ6suKWwH1XNSCV6R/qWAwChZbDWdhnYeMaUjAO70u5y/IYFNUSfFwqCTkCQj0LhtpIUo739eTFjO/+oujHvcULzbDENQ9Lj5d1VbGwcz3VP/R7b7bERY7B+q4njLm14Gqf1cnRuXg3I6MHDp0A60jbycb7wK5N9c0JlgmA4gJpI2r3+ePYbdTkqzFwW4siDmw== 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)(1800799024)(82310400026)(36860700016)(7416014)(23010399003)(376014)(22082099003)(18002099003)(921020)(56012099006)(4143699003)(11063799006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: skkyb22o+FA2AEEc6/UswPml99XuNJSteAKEX2pO0va6sTg/bQl7odZSQai/kWBPv0cPhfgB2N9UJBPMJ2DAFqVfR98+Xc04at8pFDipMLE4xx474ghsYYEpBbhred56+L3RwHekTGUiAXRO1frzc9gZcMzLwYMw+Vs7FEA2/2kM6aRbGtwOITYKUDbsZU8pG03KOhF2fgR50r1AWz+/ytteFDcvMYXIAEW2f8wJb0Q049xtN68tbw5eWbyQfcTYwc2yatQiXr6R14FnaBsu/aslCSxuNedpVENchNRKKWptCE81Fk3mTM58R7JuuCJaa1fSHWBGZrPLkz5+ufpSHJYGdaZveEaUGaQKLqm1KIHlbf3UuC4q+Er8RgjU0E6nsQjW+MNXiAoSrsqSY0+ZqUB1psFcUDZP4pJzJ03qkmO1B4TA2FWpauYbq0yHClrf X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2026 05:34:15.3061 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f7eb6377-19b5-4b04-da79-08decb68e77c 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: CY4PEPF0000FCC4.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8454 Hello Vincent, On 6/15/2026 9:54 PM, Vincent Guittot wrote: > @@ -9897,16 +9892,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; Can't we do this independent of the "pick" path if we are going to resched anyways? I suppose it is for set_next_buddy() bits but, if nse == pse, we cancel the slice protection and resched anyways and the pick will naturally go to pse so does set_next_buddy() even matter? Instead, can PREEMPT_WAKEUP_SHORT path just do a set_preempt_buddy() beforehand to ensure the task with the smallest deadline is already the ->next and pick_next_entity() readily returns that? > + > 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