Re: [PATCH 4/6] sched_ext: Report preferred NUMA nodes through ops.set_numa_node()
From: Peter Zijlstra
Date: Tue Oct 27 2026 - 06:57:21 EST
On Tue, Oct 27, 2026 at 05:13:33AM +0100, Andrea Righi wrote:
> @@ -4528,6 +4543,15 @@ static void __scx_enable_task(struct scx_sched *sch, struct task_struct *p)
>
> if (SCX_HAS_OP(sch, set_weight))
> SCX_CALL_OP_TASK(sch, set_weight, rq, p, p->scx.weight);
> +
> + if (SCX_HAS_OP(sch, set_numa_node)) {
> + s32 nid = NUMA_NO_NODE;
> +
> +#ifdef CONFIG_NUMA_BALANCING
> + nid = p->numa_preferred_nid;
> +#endif
> + SCX_CALL_OP_TASK(sch, set_numa_node, rq, p, nid);
> + }
> }
>
> void scx_enable_task(struct scx_sched *sch, struct task_struct *p)
> @@ -4834,6 +4858,20 @@ void sched_ext_dead(struct task_struct *p)
> }
> }
>
> +#ifdef CONFIG_NUMA_BALANCING
> +static void numa_node_changed_scx(struct rq *rq, struct task_struct *p, int nid)
> +{
> + struct scx_sched *sch = scx_task_sched(p);
> +
> + if (task_dead_and_done(p) ||
> + scx_get_task_state(p) != SCX_TASK_ENABLED)
> + return;
> +
> + if (SCX_HAS_OP(sch, set_numa_node))
> + SCX_CALL_OP_TASK(sch, set_numa_node, rq, p, nid);
> +}
> +#endif
I dont get this; why are you calling set_numa_mode() on enable? The
signal was sched_setnuma(), but now you're doing more.
Should not the existing enable method check p->numa_preferred_nid rather
than injecting this weird extra call?