[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20260120123113.3518950-1-wangtao554@huawei.com>
Date: Tue, 20 Jan 2026 12:31:13 +0000
From: Wang Tao <wangtao554@...wei.com>
To: <mingo@...hat.com>, <peterz@...radead.org>, <juri.lelli@...hat.com>,
<vincent.guittot@...aro.org>
CC: <dietmar.eggemann@....com>, <rostedt@...dmis.org>, <bsegall@...gle.com>,
<mgorman@...e.de>, <vschneid@...hat.com>, <tanghui20@...wei.com>,
<zhangqiao22@...wei.com>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] sched/eevdf: Update se->vprot in reweight_entity()
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 <zhangqiao22@...wei.com>
Signed-off-by: Wang Tao <wangtao554@...wei.com>
---
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,
if (!curr)
__enqueue_entity(cfs_rq, se);
cfs_rq->nr_queued++;
+ if (curr)
+ set_protect_slice(cfs_rq, se);
}
}
--
2.34.1
Powered by blists - more mailing lists