tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

tickless kernel - high level roadmap ideas



Hello NetBSD,

I've been working a little bit on how to tackle tickless in the
kernel. I'll be hoping to send some preliminary patches later this month
or so - so this is mostly an email to co-ordinate with anyone else
working or aiming to work on similar things.

The only discernable change from an API consumption perspective for the
rest of the kernel would be the appearance of bintime(9) variants of
callout(9). Functionally, when tickless is enabled finally, any
APIs which depend on sleep/wakeup semantics will have finer than 1/hz
granularity. I can't think of any other discernable consumer facing
changes at this point - feel free to mention them.

To implement tickless however, things under the hood will need to change
quite a bit.

One of the first things needed will be to discover and manage underlying
hardware timers which can interrupt at arbitrary (and/or repetitive)
timeouts. Therefore, one of the first things I'll be working on is how
to abstract this management. Since we need to support a variety of
platform/CPU/CPU-package configurations, this will be the part with a
large number of cross platform dependencies.

Once this API is in place, the callout variants using bintime, described
above, will need to be enabled to use this timer API in order to provide
sub 1/hz granularity.

Finally, consumers such as sleep/wakeup providers (cv_timedwaitbt(9),
kpause(9) etc) and a whole bunch of other functions which depend upwards
on these and others will need to be enabled to use the new sub 1/hz
callout APIs.

>From my initial experiments, and discussions with core@ , it looks like
all this can be done mostly without changing the current hardclock(9)
semantics - those semantics can simply be converted to use the new timer
management API described above.

Finally, the system time model can be updated to use high-res timers - I
won't go into detail here, because it's a bit premature to speculate
what that might look like - there seem to be a bunch of dependencies,
including into CSF(9), softint(9), heartbeat(9), and anything that polls
for timestamp updates (eg: timecounter(9) ).

Looking forward to your comments and thoughts.

Best,
-- 
Math/(~cherry)



Home | Main Index | Thread Index | Old Index