mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-06 14:35:22 +00:00
The scheduler needs a few tweaks to work in SMP mode: 1. The "cache" field just doesn't work. With more than one CPU, caching the highest priority thread isn't useful as you may need N of them at any given time before another thread is returned to the scheduler. You could recalculate it at every change, but that provides no performance benefit. Remove. 2. The "bitmask" designed to prevent the need to individually check priorities is likewise dropped. This could work, but in fact on our only current SMP system and with current K_NUM_PRIOPRITIES values it provides no real benefit. 3. The individual threads now have a "current cpu" and "active" flag so that the choice of the next thread to run can correctly skip threads that are active on other CPUs. The upshot is that a decent amount of code gets #if'd out, and the new SMP implementations for _get_highest_ready_prio() and _get_next_ready_thread() are simpler and smaller, at the expense of having to drop older optimizations. Note that scheduler synchronization is unchanged: all scheduler APIs used to require that an irq_lock() be held, which means that they now require the global spinlock via the same API. This should be a very early candidate for lock granularity attention! Signed-off-by: Andy Ross <andrew.j.ross@intel.com> |
||
---|---|---|
.. | ||
arch | ||
bluetooth | ||
crypto | ||
debug | ||
dfu | ||
display | ||
drivers | ||
dt-bindings | ||
fs | ||
linker | ||
logging | ||
misc | ||
net | ||
posix | ||
random | ||
shell | ||
toolchain | ||
usb | ||
zephyr | ||
adc.h | ||
aio_comparator.h | ||
atomic.h | ||
cache.h | ||
clock_control.h | ||
console.h | ||
counter.h | ||
crc8.h | ||
crc16.h | ||
device.h | ||
disk_access.h | ||
dma.h | ||
entropy.h | ||
eth.h | ||
fcb.h | ||
flash_map.h | ||
flash.h | ||
fs.h | ||
gpio.h | ||
i2c.h | ||
i2s.h | ||
init.h | ||
ipm.h | ||
irq_offload.h | ||
irq.h | ||
json.h | ||
kernel_version.h | ||
kernel.h | ||
led_strip.h | ||
pinmux.h | ||
power.h | ||
pwm.h | ||
ring_buffer.h | ||
rtc.h | ||
sensor.h | ||
shared_irq.h | ||
spi_legacy.h | ||
spi.h | ||
spinlock.h | ||
sw_isr_table.h | ||
sys_clock.h | ||
sys_io.h | ||
syscall.h | ||
toolchain.h | ||
uart.h | ||
watchdog.h | ||
zephyr.h |