]> Gentwo Git Trees - linux/.git/commitdiff
sched_ext: Move __SCX_DSQ_ITER_ALL_FLAGS BUILD_BUG_ON to the right place
authorTejun Heo <tj@kernel.org>
Tue, 4 Nov 2025 21:40:22 +0000 (11:40 -1000)
committerTejun Heo <tj@kernel.org>
Tue, 4 Nov 2025 21:46:24 +0000 (11:46 -1000)
The BUILD_BUG_ON() which checks that __SCX_DSQ_ITER_ALL_FLAGS doesn't
overlap with the private lnode bits was in scx_task_iter_start() which has
nothing to do with DSQ iteration. Move it to bpf_iter_scx_dsq_new() where it
belongs.

No functional changes.

Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/sched/ext.c

index 2811e4f42a379e20c0414998ab82afe825ec569c..5af015891b15d23e514e60ed53ecab43b3e33b7d 100644 (file)
@@ -474,9 +474,6 @@ struct scx_task_iter {
  */
 static void scx_task_iter_start(struct scx_task_iter *iter)
 {
-       BUILD_BUG_ON(__SCX_DSQ_ITER_ALL_FLAGS &
-                    ((1U << __SCX_DSQ_LNODE_PRIV_SHIFT) - 1));
-
        spin_lock_irq(&scx_tasks_lock);
 
        iter->cursor = (struct sched_ext_entity){ .flags = SCX_TASK_CURSOR };
@@ -6218,6 +6215,8 @@ __bpf_kfunc int bpf_iter_scx_dsq_new(struct bpf_iter_scx_dsq *it, u64 dsq_id,
                     sizeof(struct bpf_iter_scx_dsq));
        BUILD_BUG_ON(__alignof__(struct bpf_iter_scx_dsq_kern) !=
                     __alignof__(struct bpf_iter_scx_dsq));
+       BUILD_BUG_ON(__SCX_DSQ_ITER_ALL_FLAGS &
+                    ((1U << __SCX_DSQ_LNODE_PRIV_SHIFT) - 1));
 
        /*
         * next() and destroy() will be called regardless of the return value.