Re: Re: [PATCH] sched/fair: remove next_buddy_marked

From: Abel Wu
Date: Thu Dec 14 2023 - 07:23:50 EST


On 12/14/23 4:18 PM, Vincent Guittot Wrote:
On Thu, 14 Dec 2023 at 06:20, Wang Jinchao <wangjinchao@xxxxxxxxxxx> wrote:

Remove unused `next_buddy_marked` in `check_preempt_wakeup_fair`


Fixes: 5e963f2bd465 ("sched/fair: Commit to EEVDF")

After this commit @pse preempts curr without being the NEXT_BUDDY, but
IMHO it should be, so how about this?

@@ -8259,8 +8259,11 @@ 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 (pick_eevdf(cfs_rq) == pse) {
+ if (!next_buddy_marked)
+ set_next_buddy(pse);
goto preempt;
+ }

return;

which will align with before.