diff options
| author | Vincent Guittot <vincent.guittot@linaro.org> | 2026-09-21 17:22:32 +0200 |
|---|---|---|
| committer | Peter Zijlstra <peterz@infradead.org> | 2026-09-25 12:45:59 +0200 |
| commit | 4bf32ec3327d2d2286e96508cd128ce1592f43ce (patch) | |
| tree | f80553eaef8bd74d5b803f86c03906f9c1b11fc3 /kernel | |
| parent | aae2a33ea66299f39252bc1891bb4f05f631255d (diff) | |
sched/eevdf: Align update_protect_slice to set_protect_slice
Apply the same logic as for set_protect_slice when updating it.
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260921152238.3804392-3-vincent.guittot@linaro.org
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/sched/fair.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 0969be26c4d6..82155d91de06 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -821,12 +821,6 @@ static u64 ineligible_vruntime(struct cfs_rq *cfs_rq) if (curr && !curr->on_rq) curr = NULL; - /* - * This is called from set_next_task_fair(.first=true) / - * set_protect_slice() so curr had better be set and on_rq. - */ - WARN_ON_ONCE(!curr); - if (weight) { s64 runtime = cfs_rq->sum_w_vruntime; @@ -1138,10 +1132,19 @@ static inline void set_protect_slice(struct cfs_rq *cfs_rq, struct sched_entity static inline void update_protect_slice(struct cfs_rq *cfs_rq, struct sched_entity *se) { - u64 slice = cfs_rq_min_slice(cfs_rq); u64 vruntime = min_vruntime(se->vruntime, avg_vruntime(cfs_rq)); + u64 slice = normalized_sysctl_sched_base_slice; + u64 vprot; + + if (sched_feat(RUN_TO_PARITY)) + slice = cfs_rq_min_slice(cfs_rq); + + vprot = min_vruntime(se->vprot, vruntime + calc_delta_fair(slice, se)); - se->vprot = min_vruntime(se->vprot, vruntime + calc_delta_fair(slice, se)); + if (sched_feat(PREEMPT_SHORT) && slice != se->slice) + vprot = min_vruntime(vprot, ineligible_vruntime(cfs_rq)); + + se->vprot = vprot; } static inline bool protect_slice(struct sched_entity *se) |
