All of lore.kernel.org
 help / color / mirror / Atom feed
* [RT]adjtimex gives wrong number of ticks
@ 2011-09-29 12:42 Dennis Borgmann
  0 siblings, 0 replies; only message in thread
From: Dennis Borgmann @ 2011-09-29 12:42 UTC (permalink / raw)
  To: linux-rt-users

Hello RT-users!

I am observing strange behaviour regarding CONFIG_HZ on various 
machines, while trying to adjust the tickrate of some systems. I found, 
that adjtimex(2) is not behaving the way it should. If I write a simple 
program like this:

#include <stdio.h>
#include <sys/timex.h>
int main() {
     struct timex t;
     adjtimex(&t);
     printf("%ld\n",t.tick);
}

, which simply is to print the time in usec between two kernel ticks, 
the output makes no sense. On a RT-System with CONFIG_HZ=1000, the 
output is "10000" and on a non-RT system with CONFIG_HZ=250 (my 
desktop-laptop), the output is "9999" - almost the same.

If I calculate correctly, it should be 1000 with CONFIG_HZ and 4000 with 
CONFIG_HZ=250.

Am i wrong, or is this an error?

Btw: adjtimex with a tick of of 1000 gives me this:

root@ap:/tmp# adjtimex --tick 1000
adjtimex: Invalid argument
for this kernel:
    USER_HZ = 100 (nominally 100 ticks per second)
    9000 <= tick <= 11000
    -32768000 <= frequency <= 32768000

on the RT-system with CONFIG_HZ=1000. This is also odd - it should print 
"USER_HZ=1000" and not "USER_HZ=100".

Strange... Any ideas?

Best regards,
Dennis

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-09-29 12:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-29 12:42 [RT]adjtimex gives wrong number of ticks Dennis Borgmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.