[PATCH for-7.1-fixes 2/2] sched_ext: mark scx_sched_hash and dsq_hash no_sync_grow

Tejun Heo
2026-04-17T00:24:52Z

Both are inserted/removed under raw_spinlock_t (scx_sched_lock and dsq->lock
respectively). rhashtable's sync grow path is unsafe under raw_spinlock_t.
Set no_sync_grow so inserts only ever take the bucket bit-spin lock; the
deferred worker continues to grow the table.

Fixes: f0e1a0643a59 ("sched_ext: Implement BPF extensible scheduler class")
Fixes: 25037af712eb ("sched_ext: Add rhashtable lookup for sub-schedulers")
Cc: stable@vger.kernel.org # v6.11+
Signed-off-by: Tejun Heo <tj@kernel.org>
---
kernel/sched/ext.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 012ca8bd70fb..3f1467fde075 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -32,6 +32,7 @@ static const struct rhashtable_params scx_sched_hash_params = {
.key_len = sizeof_field(struct scx_sched, ops.sub_cgroup_id),
.key_offset = offsetof(struct scx_sched, ops.sub_cgroup_id),
.head_offset = offsetof(struct scx_sched, hash_node),
+ .no_sync_grow = true, /* inserted under scx_sched_lock */
};

static struct rhashtable scx_sched_hash;
@@ -122,6 +123,7 @@ static const struct rhashtable_params dsq_hash_params = {
.key_len = sizeof_field(struct scx_dispatch_q, id),
.key_offset = offsetof(struct scx_dispatch_q, id),
.head_offset = offsetof(struct scx_dispatch_q, hash_node),
+ .no_sync_grow = true, /* removed under dsq->lock */
};

static LLIST_HEAD(dsqs_to_free);
--
2.53.0