Re: [PATCH v2 2/8] sched_ext: Mark a task enabled before ops.enable()
From: Tejun Heo
Date: Fri Dec 04 2026 - 12:02:30 EST
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.
Thanks.
--
tejun