zephyr/kernel
Andrew Boie 3989de7e3b kernel: fix short time-slice reset
The kernel tracks time slice usage with the _time_slice_elapsed global.
Every time the timer interrupt goes off and the timer driver calls
_nano_sys_clock_tick_announce() with the elapsed time, this is added to
_time_slice_elapsed. If it exceeds the total time slice, the thread is
moved to the back of the queue for that priority level and
_time_slice_elapsed is reset to zero.

In a non-tickless kernel, this is the only time _time_slice_elapsed is
reset.  If a thread uses up a partial time slice, and then cooperatively
switches to another thread, the next thread will inherit the remaining
time slice, causing it not to be able to run as long as it ought to.

There does exist code to properly reset the elapsed count, but it was
only compiled in a tickless kernel. Now it is built any time
CONFIG_TIMESLICING is enabled.

Issue: ZEP-2107
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-02 14:47:01 -04:00
..
configs kernel: add LEGACY_KERNEL option 2017-01-09 19:42:13 +00:00
include kernel: fix short time-slice reset 2017-06-02 14:47:01 -04:00
alert.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
atomic_c.c license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
compiler_stack_protect.c kernel: add k_panic() and k_oops() APIs 2017-04-22 10:31:49 -04:00
device.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
errno.c kernel: errno: Use per-thread accessor function compatible with Newlib 2017-05-10 20:54:56 -04:00
idle.c kernel: tickless: Add tickless kernel support 2017-04-27 13:46:28 +00:00
init.c kernel: init: mark initial dummy thread 2017-05-13 15:14:41 -04:00
int_latency_bench.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
Kconfig test: benchmarking: Timing metrics for the kernel 2017-05-03 08:46:30 -04:00
Kconfig.event_logger kernel: Add thread events to kernel event logger 2017-04-25 02:16:36 +00:00
Kconfig.power_mgmt doc: misspellings in Kconfig files 2017-05-05 19:38:53 -04:00
mailbox.c kernel: make sure that CONFIG_OBJECT_TRACING structs are properly ifdef'ed 2017-05-18 12:41:56 -05:00
Makefile k_mem_pool: Complete rework 2017-05-13 14:39:41 -04:00
mem_slab.c kernel: make sure that CONFIG_OBJECT_TRACING structs are properly ifdef'ed 2017-05-18 12:41:56 -05:00
mempool.c k_mem_pool: Complete rework 2017-05-13 14:39:41 -04:00
msg_q.c kernel: make sure that CONFIG_OBJECT_TRACING structs are properly ifdef'ed 2017-05-18 12:41:56 -05:00
mutex.c kernel: make sure that CONFIG_OBJECT_TRACING structs are properly ifdef'ed 2017-05-18 12:41:56 -05:00
pipes.c kernel: make sure that CONFIG_OBJECT_TRACING structs are properly ifdef'ed 2017-05-18 12:41:56 -05:00
poll.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
queue.c kernel: make sure that CONFIG_OBJECT_TRACING structs are properly ifdef'ed 2017-05-18 12:41:56 -05:00
sched.c kernel: fix short time-slice reset 2017-06-02 14:47:01 -04:00
sem.c kernel: make sure that CONFIG_OBJECT_TRACING structs are properly ifdef'ed 2017-05-18 12:41:56 -05:00
stack.c kernel: make sure that CONFIG_OBJECT_TRACING structs are properly ifdef'ed 2017-05-18 12:41:56 -05:00
sys_clock.c kernel: fix short time-slice reset 2017-06-02 14:47:01 -04:00
system_work_q.c license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
thread_abort.c kernel: remove legacy kernel support 2017-04-19 15:48:37 +00:00
thread.c debug: add stack sentinel feature 2017-05-13 15:14:41 -04:00
timer.c kernel: make sure that CONFIG_OBJECT_TRACING structs are properly ifdef'ed 2017-05-18 12:41:56 -05:00
version.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
work_q.c kernel: add k_thread_create() API 2017-05-11 20:24:22 -04:00