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
include kernel: fix short time-slice reset 2017-06-02 14:47:01 -04:00
alert.c
atomic_c.c
compiler_stack_protect.c
device.c
errno.c
idle.c
init.c
int_latency_bench.c
Kconfig
Kconfig.event_logger
Kconfig.power_mgmt
mailbox.c kernel: make sure that CONFIG_OBJECT_TRACING structs are properly ifdef'ed 2017-05-18 12:41:56 -05:00
Makefile
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
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
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
thread_abort.c
thread.c
timer.c kernel: make sure that CONFIG_OBJECT_TRACING structs are properly ifdef'ed 2017-05-18 12:41:56 -05:00
version.c
work_q.c