mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-09-01 13:52:22 +00:00
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> |
||
---|---|---|
.. | ||
include | ||
atomic_c.c | ||
CMakeLists.txt | ||
compiler_stack_protect.c | ||
device.c | ||
errno.c | ||
idle.c | ||
init.c | ||
int_latency_bench.c | ||
Kconfig | ||
Kconfig.power_mgmt | ||
mailbox.c | ||
mem_domain.c | ||
mem_slab.c | ||
mempool.c | ||
msg_q.c | ||
mutex.c | ||
pipes.c | ||
poll.c | ||
queue.c | ||
sched.c | ||
sem.c | ||
smp.c | ||
stack.c | ||
system_work_q.c | ||
thread_abort.c | ||
thread.c | ||
timeout.c | ||
timer.c | ||
userspace_handler.c | ||
userspace.c | ||
version.c | ||
work_q.c |