Re: [PATCH v4 1/5] sched: Dispatch task ticks for donor and execution classes
From: Hui Su
Date: Wed Sep 09 2026 - 07:27:11 EST
On Tue, Sep 09, 2026, Sashiko AI review wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue(s) to consider:
>
> - ## [High] Infinite timeslice and preemption bypass during SCX proxy
> execution due to a mismatch between slice decrement (execution context)
> and slice checking (scheduling context).
>
> commit ff57ff4a11692a1b0d98a6cd57257eb58a1bd864
> Author: Hui Su <sh_def@xxxxxxx>
>
> Does this cause an infinite timeslice for SCX tasks during proxy execution?
>
> When an SCX task acts as a donor in proxy execution, task_tick_scx() sets
> curr to rq->donor. However, update_curr_scx() applies the slice decrement
> to the execution context (rq->curr):
>
> static void update_curr_scx(struct rq *rq)
> {
> struct task_struct *curr = rq->curr;
> ...
> if (curr->scx.slice != SCX_SLICE_INF)
> curr->scx.slice -= min_t(u64, curr->scx.slice, delta_exec);
> ...
> }
>
> Later in task_tick_scx(), the slice check is performed against the donor
> task which was never decremented:
>
> if (!curr->scx.slice)
> resched_curr(rq);
>
> Since the donor's slice doesn't decrease, it will never hit zero, meaning
> resched_curr(rq) is bypassed indefinitely.
>
> Additionally, if the proxy task is SCX but the donor is not,
> task_tick_scx() returns early here because the donor is not an SCX task,
> skipping the SCX tick processing completely. Should the slice management
> be explicitly tied to the execution context rather than the donor?
>
> --
> Sashiko AI review
Thanks for the report.
This configuration is currently unreachable. CONFIG_SCHED_PROXY_EXEC
depends on !SCHED_CLASS_EXT, so sched_ext and proxy execution cannot be
enabled together.
When CONFIG_SCHED_CLASS_EXT=y, proxy execution is disabled and rq->donor
and rq->curr alias the same task. Therefore task_tick_scx() using
rq->donor and update_curr_scx() using rq->curr still operate on the same
task, and the slice decrement and check cannot diverge.
The sched_ext change in this patch only adapts it to the new task_tick()
interface for the currently supported configuration.
If sched_ext and proxy execution are made compatible in the future, the
SCX donor/execution-context ownership will need to be handled as part of
that integration.
Thanks,
Hui