mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched/eevdf: Update se->vprot in reweight_entity()
@ 2026-01-20 12:31 Wang Tao
  2026-01-21  4:21 ` K Prateek Nayak
  2026-02-23 10:25 ` [tip: sched/urgent] " tip-bot2 for Wang Tao
  0 siblings, 2 replies; 13+ messages in thread
From: Wang Tao @ 2026-01-20 12:31 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot
  Cc: dietmar.eggemann, rostedt, bsegall, mgorman, vschneid, tanghui20,
	zhangqiao22, linux-kernel

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@huawei.com>
Signed-off-by: Wang Tao <wangtao554@huawei.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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-02-23 10:25 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-20 12:31 [PATCH] sched/eevdf: Update se->vprot in reweight_entity() Wang Tao
2026-01-21  4:21 ` K Prateek Nayak
2026-01-21  9:33   ` wangtao (EQ)
2026-01-21 17:00     ` Vincent Guittot
2026-01-22  4:38       ` K Prateek Nayak
2026-01-23 16:38         ` Vincent Guittot
2026-01-22  7:52       ` wangtao (EQ)
2026-01-23 17:32         ` Vincent Guittot
2026-01-23 15:38       ` Peter Zijlstra
2026-01-23 16:39         ` K Prateek Nayak
2026-01-23 21:31           ` Peter Zijlstra
2026-01-23 17:37         ` Vincent Guittot
2026-02-23 10:25 ` [tip: sched/urgent] " tip-bot2 for Wang Tao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®