sched-ext / scx

sched_ext schedulers and tools
https://bit.ly/scx_slack
GNU General Public License v2.0
838 stars 78 forks source link

scx_rusty: fix stats map initialization #407

Closed arighi closed 3 months ago

arighi commented 3 months ago

The stats map in scx_rusty is a BPF_MAP_TYPE_PERCPU_ARRAY, with its size determined by num_possible_cpus(). Initializing it with nr_cpu_ids() can result in errors such as:

Error: Failed to zero stat

Caused by: number of values 6 != number of cpus 8

Fix by using num_possible_cpus() to initialize it.

Fixes: 263e02f6 ("rusty: Use nr_cpu_ids instead of nr_cpus_possible")