zephyr/kernel
Andy Ross ab46b1b3c5 kernel/sched: CPU mask affinity/pinning API
This adds a simple implementation of SMP CPU affinity to Zephyr.  The
API is simple and doesn't try to invent abstractions like "cpu sets".
Each thread has an enable/disable flag associated with each CPU in the
system, and the bits can be turned on and off (for threads that are
not currently runnable, of course) using an easy three-function API.

Because the implementation picked requires enumerating runnable
threads in priority order looking for one that match the current CPU,
this is not a good fit for the SCALABLE or MULTIQ scheduler backends,
so it currently can be enabled only for SCHED_DUMB (which is the
default anyway).  Fancier algorithms do exist, but even the best of
them scale as O(N_CPUS), so aren't quite constant time and often
require significant memory overhead to keep separate lists for
different cpus/sets.

The intended use here is for apps that want to "pin" threads to
specific CPUs for latency control, or conversely to prevent certain
threads from taking time on specific CPUs to leave them free for fast
response.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-02-01 21:37:24 -05:00
..
include kernel/sched: Force inlining of some routines within the scheduler guts 2019-02-01 15:57:21 -05:00
CMakeLists.txt cmake: Use variables for target names 2019-01-19 07:21:55 -05:00
Kconfig kernel/sched: CPU mask affinity/pinning API 2019-02-01 21:37:24 -05:00
Kconfig.power_mgmt
atomic_c.c
compiler_stack_protect.c
device.c kernel: check retval of driver init 2018-12-07 19:33:23 -05:00
errno.c
idle.c power: rename api sys_soc -> sys_ 2018-12-28 16:16:28 -05:00
init.c kernel/sched: CPU mask affinity/pinning API 2019-02-01 21:37:24 -05:00
int_latency_bench.c kernel: Make statements evaluate boolean expressions 2019-01-07 08:52:07 -05:00
mailbox.c kernel: Make statements evaluate boolean expressions 2019-01-07 08:52:07 -05:00
mem_domain.c kernel: Make statements evaluate boolean expressions 2019-01-07 08:52:07 -05:00
mem_slab.c
mempool.c
msg_q.c kernel: Add missing include 2019-01-11 15:18:52 -05:00
mutex.c
pipes.c kernel: Add missing include 2019-01-11 15:18:52 -05:00
poll.c misc/dlist: Swap insertion API for a faster one 2019-02-01 15:57:21 -05:00
queue.c kernel: Add missing include 2019-01-11 15:18:52 -05:00
sched.c kernel/sched: CPU mask affinity/pinning API 2019-02-01 21:37:24 -05:00
sem.c
smp.c
stack.c kernel: Add missing include 2019-01-11 15:18:52 -05:00
system_work_q.c
thread.c kernel/sched: CPU mask affinity/pinning API 2019-02-01 21:37:24 -05:00
thread_abort.c
timeout.c misc/dlist: Swap insertion API for a faster one 2019-02-01 15:57:21 -05:00
timer.c kernel: timeout: detect inactive timeouts using dnode linked state 2019-01-23 20:46:49 +01:00
userspace.c kernel: Make statements evaluate boolean expressions 2019-01-07 08:52:07 -05:00
userspace_handler.c kernel: Make statements evaluate boolean expressions 2019-01-07 08:52:07 -05:00
version.c doc: add kernel version API to doxygen 2018-12-08 17:24:53 -05:00
work_q.c kernel: Use NULL instead of 0 2018-12-11 14:37:10 -08:00