RE: Reading /proc/stat is slooow

From: Zou, Nanhai <>
Date: 2005-12-06 20:24:16
> -----Original Message-----
> From:
> [] On Behalf Of Luck, Tony
> Sent: 2005126 14:16
> To: Andreas Schwab
> Cc:
> Subject: RE: Reading /proc/stat is slooow
> The huge bulk of the time is consumed in this loop:
> #if !defined(CONFIG_PPC64) && !defined(CONFIG_ALPHA)
>         for (i = 0; i < NR_IRQS; i++)
>                 seq_printf(p, " %u", kstat_irqs(i));
> #endif
> But why is this worse now than in 2.6.13?  At the top of
> show_stat() we already looked at all of the kstat_cpu(i).irqs[j]
> elements [but with the loops reversed: outer loop is all cpus,
> inner loop counts 0..NR_IRQ].

  I think the reason of second loop much slower than the first one is page coloring.
  For the first loop, at least cache line is hot in the inner loop.
For the second loop, things will be much worse because percpu data offset is 64k....
 But I have no idea of why 2.6.13 is much faster here.

Zou Nan hai
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to
More majordomo info at
Received on Tue Dec 06 20:24:56 2005

This archive was generated by hypermail 2.1.8 : 2005-12-06 20:25:05 EST