zephyr/kernel
Andy Ross 2724fd11cb kernel: SMP-aware scheduler
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>
2018-02-16 10:44:29 -05:00
..
include kernel: SMP-aware scheduler 2018-02-16 10:44:29 -05:00
posix kernel: Add kswap.h header to unbreak cycles 2018-02-16 10:44:29 -05:00
alert.c kernel: Provide only one _SYSCALL_HANDLER() macro 2017-10-16 13:42:15 -04:00
atomic_c.c license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
CMakeLists.txt kernel: Make irq_{un}lock() APIs into a global spinlock in SMP mode 2018-02-16 10:44:29 -05:00
compiler_stack_protect.c linker: move all linker headers to include/linker 2017-06-18 09:24:04 -05:00
device.c kernel: device: Only compare strings if pointer comparison fails 2018-02-15 17:31:59 -08:00
errno.c kernel: errno: Use per-thread accessor function compatible with Newlib 2017-05-10 20:54:56 -04:00
idle.c linker: move all linker headers to include/linker 2017-06-18 09:24:04 -05:00
init.c kernel: SMP-aware scheduler 2018-02-16 10:44:29 -05:00
int_latency_bench.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
Kconfig kernel, esp32: Add SMP kconfig flag and MP_NUM_CPUS variable 2018-02-16 10:44:29 -05:00
Kconfig.event_logger kconfig: fix more help spacing issues 2018-02-15 23:20:55 -05:00
Kconfig.power_mgmt kconfig: fix more help spacing issues 2018-02-15 23:20:55 -05:00
mailbox.c kernel: Add kswap.h header to unbreak cycles 2018-02-16 10:44:29 -05:00
mem_domain.c kernel: mem_domain: Break down assertions 2018-02-14 10:07:10 -05:00
mem_slab.c kernel: Add kswap.h header to unbreak cycles 2018-02-16 10:44:29 -05:00
mempool.c kernel: Add kswap.h header to unbreak cycles 2018-02-16 10:44:29 -05:00
msg_q.c kernel: Add kswap.h header to unbreak cycles 2018-02-16 10:44:29 -05:00
mutex.c kernel: Add kswap.h header to unbreak cycles 2018-02-16 10:44:29 -05:00
pipes.c kernel: Add kswap.h header to unbreak cycles 2018-02-16 10:44:29 -05:00
poll.c kernel: Add kswap.h header to unbreak cycles 2018-02-16 10:44:29 -05:00
queue.c kernel: Add kswap.h header to unbreak cycles 2018-02-16 10:44:29 -05:00
sched.c kernel: SMP-aware scheduler 2018-02-16 10:44:29 -05:00
sem.c kernel: Add kswap.h header to unbreak cycles 2018-02-16 10:44:29 -05:00
smp.c kernel: Make irq_{un}lock() APIs into a global spinlock in SMP mode 2018-02-16 10:44:29 -05:00
stack.c kernel: Add kswap.h header to unbreak cycles 2018-02-16 10:44:29 -05:00
sys_clock.c kernel: Allow late processing of timeouts 2018-01-29 23:18:13 -05:00
system_work_q.c kernel: introduce stack definition macros 2017-06-09 18:53:28 -04:00
thread_abort.c kernel: Add kswap.h header to unbreak cycles 2018-02-16 10:44:29 -05:00
thread.c kernel: Add kswap.h header to unbreak cycles 2018-02-16 10:44:29 -05:00
timer.c kernel: Add kswap.h header to unbreak cycles 2018-02-16 10:44:29 -05:00
userspace_handler.c userspace: assign thread IDs at build time 2017-11-03 11:29:23 -07:00
userspace.c dma: add system calls for dma_start/dma_stop 2018-02-12 19:24:25 -05:00
version.c kernel: version: no need to store version in RAM 2017-09-07 16:34:50 -07:00
work_q.c work_q: Correctly clear pending flag in delayed work queue, update docs 2018-02-13 18:08:57 -05:00