summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/ext/cid.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/sched/ext/cid.c b/kernel/sched/ext/cid.c
index 9fc219257004..20e40e3fe8ff 100644
--- a/kernel/sched/ext/cid.c
+++ b/kernel/sched/ext/cid.c
@@ -309,6 +309,12 @@ s32 scx_cid_init(struct scx_sched *sch)
* empty shard.
*/
cids_in_core = cpumask_weight(core_scratch);
+ if (cids_in_core > SCX_CID_SHARD_MAX_CPUS) {
+ scx_error(sch, "core with %u cpus exceeds max shard size %d",
+ cids_in_core, SCX_CID_SHARD_MAX_CPUS);
+ return -E2BIG;
+ }
+
max_cores = cores_per_shard + (shard_local < nr_large ? 1 : 0);
if (cores_in_shard &&
(cores_in_shard >= max_cores ||