From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from CH1PR05CU001.outbound.protection.outlook.com (mail-northcentralusazon11010006.outbound.protection.outlook.com [52.101.193.6]) (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 4B95A324700 for ; Wed, 21 Jan 2026 04:21:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.193.6 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768969322; cv=fail; b=C41kFqz8XKbkmoL4bWh1nA7BZ/XkkF9LmNVPaVh/Pidus7ij6Fa/UtdVE2Bt062UpgY8a4BGcO/ALX+qD3wZTxnE5XsgUhAIK4xMw9Jvp1WCOrGqx0JZgoGTEQCOXJopz7Zda4sY17MljDxMe/9ng8RUTAuGi+/hX6qL44ILEyI= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768969322; c=relaxed/simple; bh=3jwos/LY/e1rPsoVjJUaX/GeUMNb7pK4gnu89Rua0VI=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=mTX6g6V8ZCF8W3DItpPaHvvAysBKnXyNyAThQJBEuzvyl0OSs2dm8tpHPO8ahS+Q44FLb/SGnLIMnlF9WiSY7ufur2oYuWiU4M7QCLGG2IsuDFRPhuwzbxFDrAZyIgr835GQuBIugclEww6LzQw4Ob/55SlayU/Pm3A66gupPeA= 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=zy2h+XOa; arc=fail smtp.client-ip=52.101.193.6 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="zy2h+XOa" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XRb4WE9QY3Q7fU+0RB+9fPheOMnPAckH2bkHoU3Acu40IhB61f7+kmUyW9fESCVeBkVS2vkeVfqa8XpUb8M21JSkgqGYTX+E8BufU6RrhAStDKiLvkYHo2cNvvuqF3B3d82PUYMzr4YFjibjqbKEXIAWC1U+TCgXlBBd6G/zBD1oUtXXoWs/D808+VXckdzFKUGAkI57EQgbyxYwkfrKJqC87zbajTej4QNQ786lBYena3I6HxXYLVfSwUMtoJGwlZUPvAr2YAfZLGZY9zhoOmGDpgP8hM8NLJ/28Ezh557s23wQxkbF/sP1DSexSI3w2uxxoGN2wjnW+bbY4p0+2Q== 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=CNZSWLndfHzhn9JBtMIAraY/BWuWs7MK701N6EX586Q=; b=y/088d76W67UtyCJ3LUC3G1Xvs5JbtPtp5jeQHoqfVFnMDJoK5f1b4KzId99JpzuFPvtwtl9ETU2RwV4EAAaVWw4cAxUHP8b5B58np/MryxqSBXKt8UfsYsRy8PUXT7bOfQQo6lyfZt22+kO2ag7lQZ6GDbwZuIf/xqkwefnw5GRTr8CZChJp/mLT9UGtq+UObtfTJSAeb6AxnPYVje0ix+dfCKE7dJULvTMVXJpDtJPr/XGiKL+TvQJEfsGQUKHxokDQpORitt8054yVfJt7PWtA5eyUTTx/FLCqICyTAtCFMb+pXtrWfN9GICV4233VGpgbhq/Rj1Ru6xeG9S72g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=huawei.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=CNZSWLndfHzhn9JBtMIAraY/BWuWs7MK701N6EX586Q=; b=zy2h+XOaQpqt/BS+5W9fJcYyWxPIPAYpKMXMgd3HgXiLolTr5Imiz51A3eb6PIO84NtdZQ99rvTsuLPm7/dZxvZS8HEj4HosAVdz5QfmHVKUsrxLA2TSlTc0cGLTPmWsgCseXyajGSZl3/fQEgDV6i1Il5B5c+OyeT2sEJkFj3M= Received: from MN2PR07CA0025.namprd07.prod.outlook.com (2603:10b6:208:1a0::35) by DM4PR12MB7765.namprd12.prod.outlook.com (2603:10b6:8:113::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.9; Wed, 21 Jan 2026 04:21:50 +0000 Received: from BL6PEPF00022572.namprd02.prod.outlook.com (2603:10b6:208:1a0:cafe::5a) by MN2PR07CA0025.outlook.office365.com (2603:10b6:208:1a0::35) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9542.9 via Frontend Transport; Wed, 21 Jan 2026 04:21:49 +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 BL6PEPF00022572.mail.protection.outlook.com (10.167.249.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.4 via Frontend Transport; Wed, 21 Jan 2026 04:21:49 +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.17; Tue, 20 Jan 2026 22:21:49 -0600 Received: from [10.136.37.139] (10.180.168.240) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.17 via Frontend Transport; Tue, 20 Jan 2026 22:21:45 -0600 Message-ID: <8e7aadf8-b7a0-4500-ad2d-507665007694@amd.com> Date: Wed, 21 Jan 2026 09:51:44 +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: Update se->vprot in reweight_entity() To: Wang Tao , , , , CC: , , , , , , , References: <20260120123113.3518950-1-wangtao554@huawei.com> Content-Language: en-US From: K Prateek Nayak In-Reply-To: <20260120123113.3518950-1-wangtao554@huawei.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00022572:EE_|DM4PR12MB7765:EE_ X-MS-Office365-Filtering-Correlation-Id: a23fe7cc-6033-4f07-1a97-08de58a498d2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|376014|7416014|1800799024|7053199007; X-Microsoft-Antispam-Message-Info: =?utf-8?B?ZWVPUVdrM2k1WEtQNnJ4REZpaXNpSEtHMEcrVjZpSjlrWEZFRnR5KzBidW5F?= =?utf-8?B?L0hjaWtRbjAzRTdXSmVSamFNa0JsRisvS3NpSC9wMDEvc1UwdTZpOXlnZnJJ?= =?utf-8?B?NEpIb3Rjc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W11eTkxWVIwRXhvd1hMbWtD?= =?utf-8?B?eG5WanJJRGYwanJuTDFNaXo1cWVqOW9mV0ZycDBJYm5HRFFzQ3ZZUkpyZmpp?= =?utf-8?B?S2pic1lZejR6aGR3UldkNEVOeW02Y0xVV3ErOVNHZmNUdXFtNEdJQkl0b0Fi?= =?utf-8?B?TGRvbGtYeVExN0lNLzVBRStTUW01emRCU0hwR0k1am5Oa1hla2RJUHBYaUtP?= =?utf-8?B?bFhMYjNkRWJELzVubHQ2S3A0eHdNOG9KdEl0a2tpbmlHZjZhN2JXUGFXeEtJ?= =?utf-8?B?SXZCM1oxb2NoR1MzbnMxdmtZNGsyWnRXMG5xSXp1M1YybEc0a3gvcWRsek9a?= =?utf-8?B?SVd3RnRBNmhaSlIxYlhHTXdaSXBRPT0=?= 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)(82310400026)(36860700013)(376014)(7416014)(1800799024)(7053199007);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2026 04:21:49.4619 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a23fe7cc-6033-4f07-1a97-08de58a498d2 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: BL6PEPF00022572.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7765 Hello Wang, On 1/20/2026 6:01 PM, Wang Tao wrote: > In the EEVDF framework with Run-to-Parity protection, `se->vprot` is an > independent variable defining the virtual protection timestamp. > > When `reweight_entity()` is called (e.g., via nice/renice), it performs > the following actions to preserve Lag consistency: > 1. Scales `se->vlag` based on the new weight. > 2. Calls `place_entity()`, which recalculates `se->vruntime` based on > the new weight and scaled lag. > > However, the current implementation fails to update `se->vprot`, leading > to mismatches between the task's actual runtime and its expected duration. I don't think that is correct. "vprot" allows for "min_slice" worth of runtime from the beginning of the pick however, if we do a set_protect_slice() after reweight, we'll essentially grant another "min_slice" worth of time from the current "se->vruntime" (or until deadline if it is sooner) which is not correct. > > This patch fixes the issue by calling `set_protect_slice()` at the end of > `reweight_entity()`. This ensures that a new, valid protection slice is > committed based on the updated `vruntime` and the new weight, restoring > Run-to-Parity consistency immediately after a weight change. > > Fixes: 63304558ba5d ("sched/eevdf: Curb wakeup-preemption") > Suggested-by: Zhang Qiao > Signed-off-by: Wang Tao > --- > kernel/sched/fair.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index e71302282671..bdd8c4e688ae 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -3792,6 +3792,8 @@ static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, At the beginning of reweight_entity, we should first check if protect_slice() for curr is true or not: bool protect_slice = curr && protect_slice(se); > if (!curr) > __enqueue_entity(cfs_rq, se); > cfs_rq->nr_queued++; > + if (curr) > + set_protect_slice(cfs_rq, se); If protect_slice() was true to begin with, we should do: if (protect_slice) se->vprot = min_vruntime(se->vprot, se->deadline); This ensures that if our deadline has moved back, we only protect until the new deadline and the scheduler can re-evaluate after that. If there was an entity with a shorter slice at the beginning of the pick, the "vprot" should still reflect the old value that was calculated using "se->vruntime" at the time of the pick. -- Thanks and Regards, Prateek