bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [address@hidden: [PATCH] Make __getclktck return 100 for the Hurd]


From: Samuel Thibault
Subject: Re: [address@hidden: [PATCH] Make __getclktck return 100 for the Hurd]
Date: Tue, 18 Jun 2013 00:58:12 +0200
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Hello,

Roland McGrath, le Tue 11 Jun 2013 16:13:53 -0700, a écrit :
> > Basically, top doesn't report correct CPU times. This is caused by
> > sysconf() returning 1000000 while values read from /proc are true tick
> > counts, hence 100 per second at most.
> 
> In fact, that is not a "true tick count".  Most modern Linux kernels have
> ticks at 1024Hz, for example.  The ABI for certain /proc/PID/* files is
> that certain fields are in centiseconds.  That has nothing (except for an
> historical relationship) to do with the actual frequency used in the kernel.

Well, more or less so. It's centiseconds on x86, but other bases are
used on other archs.

> This is a bug in procfs, regardless.  If it's a good idea to change what
> libc uses, then we'll change.

The problem is that applications such as top do assume that /proc is
expressed in _SC_CLK_TCK, which does indeed work on Linux: depending
on the arch, _SC_CLK_TCK will return the proper base for /proc. Other
applications simply hardcode /proc as being centiseconds-based.  So
setting _SC_CLK_TCK to 100 and using centiseconds in /proc saves porting
headache in both cases.

Samuel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]