From nobody Sun Feb 8 05:23:33 2026 Received: from canpmsgout03.his.huawei.com (canpmsgout03.his.huawei.com [113.46.200.218]) (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 AD2CC421EE2 for ; Tue, 20 Jan 2026 12:51:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768913482; cv=none; b=nTeBFDTykf8RIPhc2Y6R4H/w1m9Zxguv7vpLWq/BXqRc1HLBZmx1tpxjlj7qLsimLt1rX61BzRC5CPPzDPASJ9F49c/R3NMnH6gw22SlhiKfFenGKDp685xGY6EDzZot6zEM7n+rAOXZXLmgTb17bKpi4Bi8DVrRCK5x9wCCaW4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768913482; c=relaxed/simple; bh=1D43HrOhuk3PR9M+Y5hhmTptYDOboWWr2kqu8kNPwJw=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=gtSxqym8NCiJaqr/5ME3wFhVztChCLvBP2wvOvfJEpSt5oyow9CCzJ1lglL+66+Tn5AoDEWPJGdy1lFmmJkiHvWmnCiFa4shrhFUOXwttBYzfUavr488B48rDxzPYAUJl1DOUlv6L67Ncg3D5zNIcnGNs9tf0CcIID/Sl7Rh+OY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=cYhCCZG7; arc=none smtp.client-ip=113.46.200.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="cYhCCZG7" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=oB4RnTozV27Tzmi7DGXQzvtBcMjXoWv8jFajIct8xXs=; b=cYhCCZG74Mlopn1aKpn4+WVpW1jEpR1jrWuVz7anbWLHsfLWe9i1zzwfu87zGB5Yke0hyLVJP qPMjuCatwDDMGsc87oCiD70/UMmLznqAbhfDYpQdrUHvAXlDYaox6nxyI+yN/TiSRbByQeXhnnh eyedgnjQQpq3h+9QdBN0inI= Received: from mail.maildlp.com (unknown [172.19.162.140]) by canpmsgout03.his.huawei.com (SkyGuard) with ESMTPS id 4dwRtX1Rj2zpT03; Tue, 20 Jan 2026 20:47:32 +0800 (CST) Received: from dggpemf100009.china.huawei.com (unknown [7.185.36.128]) by mail.maildlp.com (Postfix) with ESMTPS id 94A6F20104; Tue, 20 Jan 2026 20:51:16 +0800 (CST) Received: from huawei.com (10.67.175.29) by dggpemf100009.china.huawei.com (7.185.36.128) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 20 Jan 2026 20:51:15 +0800 From: Wang Tao To: , , , CC: , , , , , , , Subject: [PATCH] sched/eevdf: Update se->vprot in reweight_entity() Date: Tue, 20 Jan 2026 12:31:13 +0000 Message-ID: <20260120123113.3518950-1-wangtao554@huawei.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems100002.china.huawei.com (7.221.188.206) To dggpemf100009.china.huawei.com (7.185.36.128) Content-Type: text/plain; charset="utf-8" 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. 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, st= ruct sched_entity *se, if (!curr) __enqueue_entity(cfs_rq, se); cfs_rq->nr_queued++; + if (curr) + set_protect_slice(cfs_rq, se); } } =20 --=20 2.34.1