summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorHui Su <sh_def@163.com>2026-10-21 18:12:14 +0900
committerTejun Heo <tj@kernel.org>2026-10-21 11:30:03 -1000
commit651694bc47a15b99e756ebb27f4e6be6d59bf397 (patch)
tree26bab9f498c2adc7965cd1e8c17b8887787b479d /include/linux
parent3b1c7c74a6da97f86bdd31c66e8c592aa4372e16 (diff)
downloadlinux-651694bc47a15b99e756ebb27f4e6be6d59bf397.tar.gz
linux-651694bc47a15b99e756ebb27f4e6be6d59bf397.zip
sched_ext: Reject oversized automatic CID shards
Automatic topology packing starts a new shard before adding a core when the current shard would exceed its target size. However, a first core is always accepted so that cores remain indivisible. An indivisible core with more than SCX_CID_SHARD_MAX_CPUS CPUs cannot be represented without exceeding the hard shard limit. Per-shard state uses fixed-size inline cmask storage sized for SCX_CID_SHARD_MAX_CPUS. Passing an oversized shard to alloc_pshard() can therefore make cmask initialization overwrite the following fields. Reject an indivisible core larger than SCX_CID_SHARD_MAX_CPUS before adding it to a shard. Existing non-empty shard splitting already keeps the total within the hard cap, while an indivisible core may still exceed cid_shard_size when it fits within the hard limit. Report the oversized core and the hard limit with scx_error() so that the rejection is diagnosable. tj: The bug is only reproducible with artificial VM topologies. It can't happen on real hardware. Fixes: e2c841b91bf9 ("sched_ext: Add CID sharding") Reviewed-by: Andrea Righi <arighi@nvidia.com> Tested-by: Andrea Righi <arighi@nvidia.com> Signed-off-by: Hui Su <sh_def@163.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions