zephyr/kernel
Andy Ross bd049626c5 kernel/sched: Limit idle testing in preemption hot path
Idle threads must (for obvious reasons!) always be preemptible from
the perspective of the scheduler.  But when preemptive scheduling is
disabled, they are given a priority of -1, which is the lowest
COOPERATIVE priority.  So the scheduler preemption logic needed an
extra test for this case and couldn't just rely on the existing
priority comparison.  This was a measurable performance loss, as this
is a hot path on existing benchmarks.

Limit that test to circumstances (!CONFIG_PREEMPT_ENABLED) where it's
actually needed.

Longer term it would be better to just force the existence of one
"preemptible" thread priority always, but right now the number of
priorities and the state of the PREEMPT_ENABLED kconfig flag are
linked, and the existing interrupt return code (with no preemption,
you know with certainty which thread you are returning to and can skip
some work) on some platforms fails when I try this.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-02-01 15:57:21 -05:00
..
include kernel/sched: Force inlining of some routines within the scheduler guts 2019-02-01 15:57:21 -05:00
atomic_c.c
CMakeLists.txt cmake: Use variables for target names 2019-01-19 07:21:55 -05:00
compiler_stack_protect.c
device.c
errno.c
idle.c power: rename api sys_soc -> sys_ 2018-12-28 16:16:28 -05:00
init.c kernel/sched: Simplify init-time dummy thread & scheduling predicate 2019-02-01 15:57:21 -05:00
int_latency_bench.c kernel: Make statements evaluate boolean expressions 2019-01-07 08:52:07 -05:00
Kconfig Kconfig: STACK_CANARIES: Correct the help text 2019-01-23 09:44:09 +01:00
Kconfig.power_mgmt
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 kernel: mutex: delay setting lock_count = 0. 2018-12-05 11:00:10 +01:00
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: Limit idle testing in preemption hot path 2019-02-01 15:57:21 -05:00
sem.c
smp.c kernel; Checking functions return 2018-09-14 16:55:37 -04:00
stack.c kernel: Add missing include 2019-01-11 15:18:52 -05:00
system_work_q.c
thread_abort.c
thread.c kernel: Change k_is_in_isr to return bool 2019-01-07 08:52:07 -05:00
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_handler.c kernel: Make statements evaluate boolean expressions 2019-01-07 08:52:07 -05:00
userspace.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