Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The CPU incorrectly goes idle and strands tasks when a consumed task is diverted to reject_dsq.
--
--- Patch [24]: [PATCH v3 sched_ext/for-7.3 24/36] sched_ext: Add reject DSQ for cap-rejected dispatches ---
commit 17b65480202fa0fa8a74c72c6813fa99184ffb6d
Author: Tejun Heo <[email protected]>
sched_ext: Add reject DSQ for cap-rejected dispatches
This commit introduces a kernel-internal reject DSQ for the sched_ext
sub-scheduler. Tasks dispatched to a CPU where the sub-scheduler lacks
required capabilities are parked here instead of the local DSQ, and later
handed back to the BPF scheduler to re-decide.
> diff --git a/kernel/sched/ext/ext.c b/kernel/sched/ext/ext.c
> index 87a9f1ff2b0e1..d0966412ee421 100644
> --- a/kernel/sched/ext/ext.c
> +++ b/kernel/sched/ext/ext.c
[ ... ]
> @@ -2063,7 +2079,7 @@ static void move_local_task_to_local_dsq(struct scx_sched *sch,
> struct scx_dispatch_q *src_dsq,
> struct rq *dst_rq)
> {
> - struct scx_dispatch_q *dst_dsq = &dst_rq->scx.local_dsq;
> + struct scx_dispatch_q *dst_dsq = scx_local_or_reject_dsq(sch, dst_rq, p, &enq_flags);
[Severity: High]
If the task is diverted to the reject_dsq here, how do the callers handle the
fact that the local_dsq might still be empty?
For example, when scx_consume_dispatch_q() processes a task:
if (rq == task_rq) {
task_unlink_from_dsq(p, dsq);
move_local_task_to_local_dsq(sch, p, enq_flags, dsq, rq);
raw_spin_unlock(&dsq->lock);
return true;
}
Does this cause scx_consume_dispatch_q() to unconditionally return true,
leading balance_one() to believe it found a task and stop searching?
If do_pick_task_scx() then finds the local_dsq empty, could the CPU
incorrectly enter the idle state while runnable tasks remain in the global
DSQ, eventually triggering the SCX watchdog timeout?
--
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=24
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.