Summary: | sysconf(_SC_CLK_TCK) reports 100 when HZ=1000 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Denys Duchier <denys.duchier> |
Component: | [OLD] Core system | Assignee: | Martin Schlemmer (RETIRED) <azarah> |
Status: | RESOLVED INVALID | ||
Severity: | major | CC: | bjb, zwelch |
Priority: | High | ||
Version: | 1.4_rc1 | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | illustrates the problem |
Description
Denys Duchier
2002-10-24 04:51:56 UTC
Created attachment 4967 [details]
illustrates the problem
running this testcase on my machine produces the following output:
according to gettimeofday: 5000
according to ticks: 50010
sysconf(_SC_CLK_TCK)=100
either times is wrong or sysconf(_SC_CLK_TCK) is wrong. either way,
time computing according to ticks is off by a factor of 10.
This is a glibc *inconsistency*. Glibc hardwires that on i386 jiffies is always 100 and 1024 on alpha for example. Its not possible to provide a quick fix for that. Such a solution would require a couple of changes to kernel and glibc. Note that the jiffies patch to kernel 2.4 still is *experimental* . There are other possible problems associated to it as well. So in case this is critical for you , set the jiffies back to 100 in the kernel configuration. I will check what glibc2.3 does though. no, I am now checking for the bug in our configure script and adjusting the computation using the appropriate ratio. Since you confirm that this is a glibc bug (which btw the way I tried to check before reporting the problem and could not locate in their bug db), I imagine that it will pop up in other systems as well. my problem is that I need to make the compilation of our VM robust in the face of such eventualities. I could of course change the jiffies thing on my machine, but that would not help users of our VM on other systems. I just hope you know whom to bug about it :-) As bjb said, the jiffies patch is experimental, and from own experience do have some issues with some drivers. If the glibc guys will fix it for you, reopen this with the patch, or URL to it, else change your jiffies to the default 100. |