UP and SMP
Linux kernel control path
UP vs SMP
API
常见的control path:
ISR
Softirq/tasklet : bh
上面两个不能context switch
exception/system call : from user to kernel
setup CR to solve
R/W lock ?
sequence_lock ?
Big Table ?
cpu need HW support for CR
for x86, cmpxchg, compare, exchange
for ARM test_set instruction
CR越小越好
对于singel core, 可以yield cpu,这就要control path必须是一般的path, 而且可以被preempt
从spin_lock进入的时候,kpath要唯一,这样才不容易死锁,不要在中断中。SMP 要和UP一样操作。
almost all sync API combine with disable_irq/softirq/preempt_Ex
spin_lock call arch_spin_lock ?
for multicore exclusive instruction, 保证atomic
Read - check - CR (test)
for SMP, LOCK_BREAK is used