zephyr/kernel
Ramesh Thomas 89ffd44dfb kernel: tickless: Add tickless kernel support
Adds event based scheduling logic to the kernel. Updates
management of timeouts, timers, idling etc. based on
time tracked at events rather than periodic ticks. Provides
interfaces for timers to announce and get next timer expiry
based on kernel scheduling decisions involving time slicing
of threads, timeouts and idling. Uses wall time units instead
of ticks in all scheduling activities.

The implementation involves changes in the following areas

1. Management of time in wall units like ms/us instead of ticks
The existing implementation already had an option to configure
number of ticks in a second. The new implementation builds on
top of that feature and provides option to set the size of the
scheduling granurality to mili seconds or micro seconds. This
allows most of the current implementation to be reused. Due to
this re-use and co-existence with tick based kernel, the names
of variables may contain the word "tick". However, in the
tickless kernel implementation, it represents the currently
configured time unit, which would be be mili seconds or
micro seconds. The APIs that take time as a parameter are not
impacted and they continue to pass time in mili seconds.

2. Timers would not be programmed in periodic mode
generating ticks. Instead they would be programmed in one
shot mode to generate events at the time the kernel scheduler
needs to gain control for its scheduling activities like
timers, timeouts, time slicing, idling etc.

3. The scheduler provides interfaces that the timer drivers
use to announce elapsed time and get the next time the scheduler
needs a timer event. It is possible that the scheduler may not
need another timer event, in which case the system would wait
for a non-timer event to wake it up if it is idling.

4. New APIs are defined to be implemented by timer drivers. Also
they need to handler timer events differently. These changes
have been done in the HPET timer driver. In future other timers
that support tickles kernel should implement these APIs as well.
These APIs are to re-program the timer, update and announce
elapsed time.

5. Philosopher and timer_api applications have been enabled to
test tickless kernel. Separate configuration files are created
which define the necessary CONFIG flags. Run these apps using
following command
make pristine && make BOARD=qemu_x86 CONF_FILE=prj_tickless.conf qemu

Jira: ZEP-339 ZEP-1946 ZEP-948
Change-Id: I7d950c31bf1ff929a9066fad42c2f0559a2e5983
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2017-04-27 13:46:28 +00:00
..
configs kernel: add LEGACY_KERNEL option 2017-01-09 19:42:13 +00:00
include kernel: tickless: Add tickless kernel support 2017-04-27 13:46:28 +00:00
Kconfig kernel: Add stack_info to k_thread 2017-04-25 16:02:38 +00:00
Kconfig.event_logger kernel: Add thread events to kernel event logger 2017-04-25 02:16:36 +00:00
Kconfig.power_mgmt kernel: tickless: Add tickless kernel support 2017-04-27 13:46:28 +00:00
Makefile kernel: remove legacy kernel support 2017-04-19 15:48:37 +00: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 license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
idle.c kernel: tickless: Add tickless kernel support 2017-04-27 13:46:28 +00:00
init.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
int_latency_bench.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
mailbox.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
mem_pool.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
mem_slab.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
msg_q.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
mutex.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
pipes.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
poll.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
queue.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
sched.c kernel: tickless: Add tickless kernel support 2017-04-27 13:46:28 +00:00
sem.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
stack.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
sys_clock.c kernel: tickless: Add tickless kernel support 2017-04-27 13:46:28 +00:00
system_work_q.c license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
thread.c kernel: tickless: Add tickless kernel support 2017-04-27 13:46:28 +00:00
thread_abort.c kernel: remove legacy kernel support 2017-04-19 15:48:37 +00:00
timer.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -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 Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00