sched: add depends on ARCH_INTERRUPTSTACK to SMP

Change-Id: I7edbbcf314045c5567e30b39b0693672e5d10e9a
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd 2021-06-28 16:57:19 +08:00 committed by Xiang Xiao
parent ee66da4566
commit a96cab58ad

View File

@ -268,6 +268,7 @@ config SMP
default n
depends on ARCH_HAVE_MULTICPU
depends on ARCH_HAVE_TESTSET
depends on ARCH_INTERRUPTSTACK != 0
select SPINLOCK
select SCHED_RESUMESCHEDULER
select IRQCOUNT
@ -275,6 +276,17 @@ config SMP
Enables support for Symmetric Multi-Processing (SMP) on a multi-CPU
platform.
N.B. SMP mode requires the use of ARCH_INTERRUPTSTACK:
CPU0 thread0 -> IRQ enter -> add thread0 to block_list -> IRQ leave(crash)
||
/\
/ \
CPU1 thread1 -> block_task -> take thread0 from block_list -> run thread0
CPU0 IRQ handler use thread0's stack, but thread0 may switch to CPU1, that
will caused IRQ handler stack corruption.
if SMP
config SMP_NCPUS