9098a45c84
Instead of checking every time we hit the low-level context switch path to see if the new thread has a "partner" with which it needs to share time, just run the slice timer always and reset it from the scheduler at the points where it has already decided a switch needs to happen. In TICKLESS_KERNEL situations, we pay the cost of extra timer interrupts at ~10Hz or whatever, which is low (note also that this kind of regular wakeup architecture is required on SMP anyway so the scheduler can "notice" threads scheduled by other CPUs). Advantages: 1. Much simpler logic. Significantly smaller code. No variance or dependence on tickless modes or timer driver (beyond setting a simple timeout). 2. No arch-specific assembly integration with _Swap() needed 3. Better performance on many workloads, as the accounting now happens at most once per timer interrupt (~5 Hz) and true rescheduling and not on every unrelated context switch and interrupt return. 4. It's SMP-safe. The previous scheme kept the slice ticks as a global variable, which was an unnoticed bug. Signed-off-by: Andy Ross <andrew.j.ross@intel.com> |
||
---|---|---|
.. | ||
cortex_m | ||
offsets | ||
CMakeLists.txt | ||
Kconfig | ||
__aeabi_atexit.c | ||
cpu_idle.S | ||
exc_exit.S | ||
fatal.c | ||
fault.c | ||
fault_s.S | ||
irq_init.c | ||
irq_manage.c | ||
irq_offload.c | ||
irq_relay.S | ||
isr_wrapper.S | ||
swap.c | ||
swap_helper.S | ||
sys_fatal_error_handler.c | ||
thread.c | ||
thread_abort.c | ||
userspace.S |