Check whether the wakeup task is eligible first
PATCH v2 1/1 Check whether the wakeup task is eligible first
check_prempt_wakeup_fair is checking whether the current task has to be preempted by the newly wake-up task. To avoid multiple swaps the logic is decided as if the wake-up task is the best task then only preempt the current task.
In CFS time, getting the best task was as simple as piking the left-most node. But in EEVDF non-fast path, the entire tree has to be traversed in a worst case scenario.
So, IMHO let's first check the newly wake-up task is eligible before searching for the best task.
Signed-off-by Balakumaran Kannan <[email protected]>
---
Changes in v2:
- Fixed the commit message with proper name and Signed-off-by
kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/fair.c +1 -1
@@ -8334,7 +8334,7 @@ static void check_preempt_wakeup_fair(struct rq *rq, struct task_struct *p, int/* * XXX pick_eevdf(cfs_rq) != se ? */ -if (pick_eevdf (cfs_rq) == pse) +if (entity_eligible (cfs_rq, pse) && (pick_eevdf (cfs_rq) == pse)) goto preempt;return ;
Signature · 1 line
2.33.8