Topics

[RFCv2 0/2] System Timer API


Luiz Augusto von Dentz
 

From: Luiz Augusto von Dentz <luiz.von.dentz(a)intel.com>

So at this point it works properly, I tested what could be the minimal stack
necessary in order to run the timer queue and arrive at 512 bytes which is 4
times bigger than what we used to have when using a delayed fiber in SMP so the
timer API only really payoff in terms of memory in case there is 4 or more
timer active, which there will be since we will be adding more user for that
in ATT and L2CAP protocols.

Ive also make the timer queue abort if there is no timers left, this is
something that perhaps is not such a good idea if there is too much
overhead starting the fibers on demand, perhaps by the it cannot be used if
the ticks are low perhaps it is shorter then starting a fiber thus loosing
precision. Anyway the idea here is not to invent a high precision timer, in
fact later on we may introduce a function that takes the timeout in seconds
instead of ticks and then coalesce multiple timers that would happen in the
same second thus reducing the amount of wakeups.

v2: Move timer under misc, make use of system log support.

Luiz Augusto von Dentz (2):
misc: Add timer API
Bluetooth: SMP: Make use of bt_timer API

include/misc/timer.h | 106 ++++++++++++++++++++++++
misc/Kconfig | 37 +++++++++
misc/Makefile | 1 +
misc/timer.c | 224 ++++++++++++++++++++++++++++++++++++++++++++++++++
net/bluetooth/Kconfig | 1 +
net/bluetooth/smp.c | 40 ++++-----
6 files changed, 386 insertions(+), 23 deletions(-)
create mode 100644 include/misc/timer.h
create mode 100644 misc/timer.c

--
2.5.5