[PATCH 6.12 111/242] sched/fair: Use protect_slice() instead of direct comparison

Greg Kroah-Hartman
2026-04-08T18:45:30Z

From: Vincent Guittot <vincent.guittot@linaro.org>

[ Upstream commit 9cdb4fe20cd239c848b5c3f5753d83a9443ba329 ]

Replace the test by the relevant protect_slice() function.

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Dhaval Giani (AMD) <dhaval@gianis.ca>
Link: https://lkml.kernel.org/r/20250708165630.1948751-2-vincent.guittot@linaro.org
Stable-dep-of: 1319ea57529e ("sched/fair: Fix zero_vruntime tracking fix")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/sched/fair.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index efd3cbefb5a22..fff27f3378cbf 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1181,7 +1181,7 @@ static inline bool did_preempt_short(struct cfs_rq *cfs_rq, struct sched_entity
if (!sched_feat(PREEMPT_SHORT))
return false;

- if (curr->vlag == curr->deadline)
+ if (protect_slice(curr))
return false;

return !entity_eligible(cfs_rq, curr);
--
2.53.0