Commit a4f61f0a authored by Andrea Righi's avatar Andrea Righi Committed by Tejun Heo
Browse files

sched_ext: Documentation: Add ops.dequeue() to task lifecycle



Document ops.dequeue() in the sched_ext task lifecycle now that its
semantics are well-defined.

Also update the pseudo-code to use task_is_runnable() consistently and
clarify the case where ops.dispatch() does not refill the time slice.

Signed-off-by: default avatarAndrea Righi <arighi@nvidia.com>
Reviewed-by: default avatarEmil Tsalapatis <emil@etsalapatis.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent a3c3fb2f
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
@@ -422,22 +422,28 @@ by a sched_ext scheduler:

        ops.runnable();         /* Task becomes ready to run */

        while (task is runnable) {
        while (task_is_runnable(task)) {
            if (task is not in a DSQ && task->scx.slice == 0) {
                ops.enqueue();  /* Task can be added to a DSQ */

                /* Task property change (i.e., affinity, nice, etc.)? */
                if (sched_change(task)) {
                    ops.dequeue(); /* Exiting BPF scheduler custody */
                    continue;
                }
            }

            /* Any usable CPU becomes available */

            ops.dispatch();     /* Task is moved to a local DSQ */
            ops.dequeue();      /* Exiting BPF scheduler custody */

                ops.dequeue(); /* Exiting BPF scheduler */
            }
            ops.running();      /* Task starts running on its assigned CPU */

            while task_is_runnable(p) {
                while (task->scx.slice > 0 && task_is_runnable(p))
            while (task_is_runnable(task) && task->scx.slice > 0) {
                ops.tick();     /* Called every 1/HZ seconds */

                if (task->scx.slice == 0)
                    ops.dispatch(); /* task->scx.slice can be refilled */
            }