Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I am working on kernel code which uses the timers available in the kernel code - i.e. add_timer. However, the best resolution that can offer is 10ms. I know ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2005
    Location
    India
    Posts
    15

    Question Need Higher Timer Resolution in Kernel than 10ms


    Hi,
    I am working on kernel code which uses the timers available in the kernel code - i.e. add_timer. However, the best resolution that can offer is 10ms.
    I know that I can recompile the kernel and change the HZ variable - that will reduce the interval between the clock ticks and give me better resolution, however that will also cause higher overhead.
    Does someone know of a better way to get higher resolution in the kernel?

  2. #2
    Just Joined!
    Join Date
    Jun 2005
    Location
    Canada, Halifax
    Posts
    86
    Higher time resolution comes at a higher overhead. I've written several single-user micro kernels for DSP embedded systems that act on events within four to six instruction clock cycles: high time resolution and low overhead are mutually exclusive. The best you can do is trade off one against the other.

    Consider enabling kernel premption. You may not be happy with the system
    overhead, on the other hand it is specifically designed for low-latency, real-time systems. http://kpreempt.sourceforge.net/

  3. #3
    Just Joined!
    Join Date
    Jan 2005
    Location
    India
    Posts
    15

    Post

    @davebardsley

    Thanks I'll check kernel pre-emption out.
    I do realise that higher resolution will have higher overhead but I feel that increasing frequency of clock-ticks will have a very high overhead since there are other activities done by the kernel on every clock-tick interrupt.
    How did you manage to get that resolution(four to six instruction clock cycles)?
    Was it by decreasing the value of HZ in the kernel or was it thru some other mechanism?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •