RE: Linux 2.4.19ac3rc3 on IBM x330/x340 SMP - "ps" time skew

David Luyer (david@luyer.net)
Wed, 31 Jul 2002 21:01:45 +1000


I wrote:

> In Linux 2.4.19ac3rc3 on IBM x330/x340 SMP systems we're seeing this:
>
> luyer@praxis8:~$ ps auxwww | tail -1
> luyer 1025 0.0 0.0 1276 352 pts/2 S Aug06 0:00 tail -1
> luyer@praxis8:~$ date
> Wed Jul 31 12:35:16 EST 2002

(UP systems are fine, SMP have this problem)

Reason:

luyer@praxis8:~$ ps --info 2>&1 | grep Hertz
EUID=111 TTY=136,3 Hertz=50

procps is getting the hertz value wrong, it's computing it as:

h = (unsigned long)( (double)jiffies/seconds/smp_num_cpus );

but we're only getting timer interrupts on CPU 0, and hence
jiffies is only incrementing once per 100th of a second.

luyer@praxis8:~/procps/procps-2.0.7.orig/proc$ cat /proc/interrupts
CPU0 CPU1
0: 52459351 0 local-APIC-edge timer
1: 0 2 IO-APIC-edge keyboard
2: 0 0 XT-PIC cascade
24: 883655 863043 IO-APIC-level ips
26: 7 9 IO-APIC-level aic7xxx
27: 8 8 IO-APIC-level aic7xxx
28: 97880608 96542591 IO-APIC-level eth0
NMI: 0 0
LOC: 52456889 52456887
ERR: 0
MIS: 0

procps version is 2.0.7 (Debian 3.0).

Where's the mistake -- should timer interrupts be on both
CPUs (I think this is the problem), or is procps miscalculating
Hz (seems less likely, someone would have noticed by now...)?

David.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/