kernel: SMP: allow more than 5 CPU cores

Previously we limit maximum number of CPU cores to 5, now be
bumping this restriction so we can use 12 cores.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
This commit is contained in:
Evgeniy Paltsev 2023-09-19 22:20:36 +01:00 committed by Carles Cufí
commit 54e0731666
3 changed files with 8 additions and 4 deletions

View file

@ -121,8 +121,12 @@ struct _thread_base {
#ifdef CONFIG_SCHED_CPU_MASK
/* "May run on" bits for each CPU */
#if CONFIG_MP_MAX_NUM_CPUS <= 8
uint8_t cpu_mask;
#else
uint16_t cpu_mask;
#endif
#endif /* CONFIG_SCHED_CPU_MASK */
/* data returned by APIs */
void *swap_data;

View file

@ -989,7 +989,7 @@ config SMP_BOOT_DELAY
config MP_NUM_CPUS
int "Number of CPUs/cores"
default MP_MAX_NUM_CPUS
range 1 5
range 1 12
help
Number of multiprocessing-capable cores available to the
multicpu API and SMP features.
@ -997,7 +997,7 @@ config MP_NUM_CPUS
config MP_MAX_NUM_CPUS
int "Maximum number of CPUs/cores"
default 1
range 1 5
range 1 12
help
Maximum number of multiprocessing-capable cores available to the
multicpu API and SMP features.

View file

@ -1621,8 +1621,8 @@ static inline int z_vrfy_k_is_preempt_thread(void)
#ifdef CONFIG_SCHED_CPU_MASK
# ifdef CONFIG_SMP
/* Right now we use a single byte for this mask */
BUILD_ASSERT(CONFIG_MP_MAX_NUM_CPUS <= 8, "Too many CPUs for mask word");
/* Right now we use a two byte for this mask */
BUILD_ASSERT(CONFIG_MP_MAX_NUM_CPUS <= 16, "Too many CPUs for mask word");
# endif