Re: [PATCH v2 2/8] sched_ext: Mark a task enabled before ops.enable()
From: Changwoo Min
Date: Sun Dec 06 2026 - 00:38:56 EST
On 12/5/26 2:02 AM, Tejun Heo wrote:
Hello, Changwoo.
On Thu, Dec 03, 2026 at 01:56:12PM +0900, Changwoo Min wrote:
scx_enable_task() sets SCX_TASK_ENABLED only after ops.enable() returns.
A task kfunc that accepts only enabled tasks, as scx_bpf_task_set_priv()
will, then refuses calls from ops.enable(). That is where a scheduler
sets up what it keeps for @p while controlling it.
Why does scx_bpf_task_set_priv() need to care whether the task is enabled?
AFAICS, now that the fields are reset after ops.exit_task(), the
scx_task_on_sched() test should be enough. If the sched owns the task, it
should be fine for it to set the value, and then we wouldn't need this
change.
Agreed. v3 drops this patch. The value now belongs to the scheduler that
owns the task, from after ops.init_task() until ops.exit_task(), and the
kernel clears it after ops.exit_task().
Regards,
Changwoo