Skip to content

Commit 9ad2861

Browse files
Yipeng Zouhtejun
authored andcommitted
sched_ext: Allow dequeue_task_scx to fail
Since dequeue_task() allowed to fail, there is a compile error: kernel/sched/ext.c:3630:19: error: initialization of ‘bool (*)(struct rq*, struct task_struct *, int)’ {aka ‘_Bool (*)(struct rq *, struct task_struct *, int)’} from incompatible pointer type ‘void (*)(struct rq*, struct task_struct *, int)’ 3630 | .dequeue_task = dequeue_task_scx, | ^~~~~~~~~~~~~~~~ Allow dequeue_task_scx to fail too. Fixes: 863ccdb ("sched: Allow sched_class::dequeue_task() to fail") Signed-off-by: Yipeng Zou <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 5ac9985 commit 9ad2861

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

kernel/sched/ext.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,11 +2033,11 @@ static void ops_dequeue(struct task_struct *p, u64 deq_flags)
20332033
}
20342034
}
20352035

2036-
static void dequeue_task_scx(struct rq *rq, struct task_struct *p, int deq_flags)
2036+
static bool dequeue_task_scx(struct rq *rq, struct task_struct *p, int deq_flags)
20372037
{
20382038
if (!(p->scx.flags & SCX_TASK_QUEUED)) {
20392039
WARN_ON_ONCE(task_runnable(p));
2040-
return;
2040+
return true;
20412041
}
20422042

20432043
ops_dequeue(p, deq_flags);
@@ -2072,6 +2072,7 @@ static void dequeue_task_scx(struct rq *rq, struct task_struct *p, int deq_flags
20722072
sub_nr_running(rq, 1);
20732073

20742074
dispatch_dequeue(rq, p);
2075+
return true;
20752076
}
20762077

20772078
static void yield_task_scx(struct rq *rq)

0 commit comments

Comments
 (0)