Re: [PATCH] sched_ext: Document task ownership state machine
From: Tejun Heo
Date: Wed Mar 04 2026 - 11:43:31 EST
Hello,
On Wed, Mar 04, 2026 at 04:33:43PM +0100, Andrea Righi wrote:
> + * Task Ownership State Machine (sched_ext_entity->ops_state)
> *
> + * The sched_ext core uses this state machine to track task ownership
> + * between the SCX core and the BPF scheduler. This allows the BPF
> + * scheduler to dispatch tasks without strict ordering requirements, while
> + * the SCX core safely rejects invalid dispatches.
> *
> + * State Transitions
> *
> + * .------------> NONE (owned by SCX core)
> + * | | ^
> + * | enqueue | | direct dispatch
> + * | v |
> + * | QUEUEING -------'
> + * | |
> + * | enqueue |
> + * | completes |
> + * | v
> + * | QUEUED (owned by BPF scheduler)
> + * | | ^
> + * | dispatch | | affinity changed
> + * | | | (dispatch aborts)
> + * | v |
> + * | DISPATCHING -----'
> + * | |
> + * | dispatch |
> + * | completes |
> + * `---------------'
I don't think we transition tasks from DISPATCHING to QUEUED on affinity
changes. Not yet anyway, right?
Thanks.
--
tejun