Re: [PATCH 07/17] sched_ext: Add topological CPU IDs (cids)

Kuba Piecuch
2026-04-28T13:00:27Z

Hi Tejun,

Relaying a minor finding from Sashiko's review:
https://sashiko.dev/#/patchset/20260424172721.3458520-1-tj%40kernel.org

Might also be worth having a look at the findings for other patches in the
series.

> @@ -6727,6 +6728,16 @@ static void scx_root_enable_workfn(struct kthread_work *work)
> */
> cpus_read_lock();
>
> + /*
> + * Build the cid mapping before publishing scx_root. The cid kfuncs
> + * dereference the cid arrays unconditionally once scx_prog_sched()
> + * returns non-NULL; the rcu_assign_pointer() below pairs with their
> + * rcu_dereference() to make the populated arrays visible.
> + */
> + ret = scx_cid_init(sch);
> + if (ret)
> + goto err_disable;
> +

Are we missing cpus_read_unlock() on the error path here?

Thanks,
Kuba