need a timer which can be precise at 1 ms level
Feixiong Zhang <[email protected]> Sun, 19 Aug 2012 11:30:58 -0400
| Newsgroups | gmane.network.routing.click |
|---|---|
| Message-ID | <CA+PrAhUAETSj5rSNC+SEtBEe2m4_5oWvZJ3BvKdBove4VJ+u_Q@mail.gmail.com> |
Hi, all, I'm implementing a network-delay module as a click kernel module. What the module does is that when it gets a packets, it will delay the packet for a certain time (at millisecond order based on the packet's incoming address) and then release it back to host stack. So I need a timer that can fire precisely at millisecond level. I test the click timer's function schedule_after_msec(1), but the timer actually fires after normally 5~7 ms. Is there any other way to get a more precise timer? I took a look at the timer document, it says there is a function adjustment() which seems can be used. Can someone explain how it works in more detail? Besides, what I found for the function timer.schedule_after_msec(1) is if there are more frequent packets entering into the delay module, the timer firing task will be delayed much more severely. Normally it will fire after the incoming packets become sparse, but that is already long time later than the time it should fire. Is this normal for click? I'm using patchless click on linux 2.6.35-30-generic. I will appreciate a lot if anyone can give some hints. Thanks. Best Regards. Feixiong