Find the answer to your Linux question:
Results 1 to 5 of 5
Sorry for the wall of text but i hope someone has the time to help me Have spent many days trying to get this working so maybe someone can help ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2012
    Posts
    3

    Unhappy Kernel timer frequency help


    Sorry for the wall of text but i hope someone has the time to help me

    Have spent many days trying to get this working so maybe someone can help me out with this issue. Lately i have tried to built some game servers (counter-strike 1.6) where the timer frequency should run 1000 Hz to insure smooth gameplay.

    Started out with minimal version of debian and recompiled the kernel to run 1000Hz, Disable tickless system and enable high resolution timers. (Since iam a new user i cant post a link the the guide i have followed but if you search on google for EN:Linux Kernel Optimization you can find it and check all the .config settings)

    Played with a lot of different kernel versions and compilation settings and found out that kernel 2.6.26.1 gave 1000Hz pretty stable (Version 2.6.18.x also gave 1000 Hz). But these are pretty old kernel version so i tried 2.6.33.1, 3.0.x, 3.2x and other newer kernel versions that i cant remember. The result was the same from the newer kernel versions, they were all fluctuating between 850-980Hz.

    And the funny thing with the newer kernels are that compiling the kernels with 100,250 or 1000Hz gives 850-980Hz as a result in all cases.

    If i recompile the older kernels 100Hz=100Hz and 1000Hz =1000Hz

    So my question is what sets/decides the timer frequency in the newer kernel versions? Because my conclusion is that something has changed at some point between the versions.

    Have tested this on 3 different computers and tried both debian and centos distributions.

    Systems: AMD64 3700+, AMD64 3200+, intel E8500

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    11,159
    Timer ticks for Linux are in jiffies - between 1 and 10ms, usually (these days since kernel 2.6.13) at 4ms on i386 systems. On newer x86_64 systems it will be between 1 and 10ms, as you have seen. This is the interrupt timer interval.This is not really mutable, even recompiling the kernel to run at different "speeds". So, to answer your question as to what sets/decides the timer frequency? It is the interrupt timer, which can be adjusted by setting a value in the appropriate timer chip register. IE, even after you load the kernel, you can adjust the interrupt timer as needed, which is done when you install the real-time extensions to the kernel.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Feb 2012
    Posts
    3
    Quote Originally Posted by Rubberman View Post
    Timer ticks for Linux are in jiffies - between 1 and 10ms, usually (these days since kernel 2.6.13) at 4ms on i386 systems. On newer x86_64 systems it will be between 1 and 10ms, as you have seen. This is the interrupt timer interval.This is not really mutable, even recompiling the kernel to run at different "speeds". So, to answer your question as to what sets/decides the timer frequency? It is the interrupt timer, which can be adjusted by setting a value in the appropriate timer chip register. IE, even after you load the kernel, you can adjust the interrupt timer as needed, which is done when you install the real-time extensions to the kernel.
    Thanks for your help But since iam still half new in linux do you think that you can give an example how to do that? Iam unsure what and how to change an value in the timer chip register and adjust the interrupt timer.

    All the kernels i have tried has been patched with a RT patch iam not sure if that's what you mean with real-time extensions :/

  4. #4
    Just Joined!
    Join Date
    Jan 2011
    Location
    Fairfax, Virginia, USA
    Posts
    94
    Hi Theaclaeb,
    The testing your doing is impressive. May I ask how you are measuring timer performance? Are you using a "C" application running as SCHED_FIFO or SCHED_RR or are you measuring delta's from files in /proc?

  5. #5
    Just Joined!
    Join Date
    Feb 2012
    Posts
    3
    Quote Originally Posted by BrianMicek View Post
    Hi Theaclaeb,
    The testing your doing is impressive. May I ask how you are measuring timer performance? Are you using a "C" application running as SCHED_FIFO or SCHED_RR or are you measuring delta's from files in /proc?
    Tried measuring the frequency by the /proc/timer_list and the /proc/timer interupts and found out that it made 10004 jiffies in 10 seconds. So if I assume that 1 jiffies is 1ms it gives a timer frequency at 1000Hz.

    But the game counter strike 1.6 showed 850-1000 fps (HZ = fps) so i have tried a lot of settings and found out by changing the clocksource to a source called jiffies I got 999-1000 fps totally stable.

    So now iam wondering where this clocksource has gone in the newer kernel versions since the clocksource tsc, hpet and acpi_pm didn't worked. Anybody know if I can select/add this clocksource when compiling the kernel?

Posting Permissions

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