Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 863ccdbb918a ("sched: Allow sched_class::dequeue_task() to fail")
Signed-off-by: Yipeng Zou <zouyipeng@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Yipeng Zou and committed by
Tejun Heo
9ad2861b 5ac99857

+3 -2
+3 -2
kernel/sched/ext.c
··· 2033 2033 } 2034 2034 } 2035 2035 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) 2037 2037 { 2038 2038 if (!(p->scx.flags & SCX_TASK_QUEUED)) { 2039 2039 WARN_ON_ONCE(task_runnable(p)); 2040 - return; 2040 + return true; 2041 2041 } 2042 2042 2043 2043 ops_dequeue(p, deq_flags); ··· 2072 2072 sub_nr_running(rq, 1); 2073 2073 2074 2074 dispatch_dequeue(rq, p); 2075 + return true; 2075 2076 } 2076 2077 2077 2078 static void yield_task_scx(struct rq *rq)