Dynamic ticks in FreeBSD
ozawa+bsd at t-oza.net
Tue Mar 30 13:39:06 UTC 2010
I started to work dynamic ticks in FreeBSD, and now experimental
code start to work roughly.
The code is here : http://github.com/oza/FreeBSD-8.0-dyntick
The timer interrupt handler works as follows :
1. Scan callout queue and get when the timer fire. This is the value
we can skip.
2. Run hardware timer in "oneshot mode" instead of periodic mode.
My experimental code only work for local apic timer.
After translating the value which is gotten at 1 to local apic timer
count, pass the value to local apic timer.
3. Exit timer interrupt handler.
My experimental code needs a kernel module to switch to dynamic
tick mode. The kernel module is here : http://gist.github.com/345917
The benchmark is here :
The result says that dynticks can save CPU power significantly,
so this worth to work. But this is incomplete to work kernel components
correctly. There are a lot of problems:
1. The global variable "ticks" isn't incremented by 2 and above.
This gets worse the response.
2. To fix problem 1, I have to hack scheduler and profiler.
If I do 1, these kernel component doesn't work correctly.
But 2. is very expensive to implement. I think that it's good to
switch between periodic ticks mode and dynamic ticks mode
when isched_idletd is scheduled. So I'm planning to do this as
a next step.
If you have some idea or question about this work,
please let me know. Thank you!
Very truly yours
<ozawa at t-oza.net>
More information about the freebsd-hackers