Re: Problem: scaling of /proc/stat on large systems

From: KAMEZAWA Hiroyuki
Date: Mon Oct 04 2010 - 21:42:50 EST


On Mon, 4 Oct 2010 09:34:15 -0500
Jack Steiner <steiner@xxxxxxx> wrote:

> On Thu, Sep 30, 2010 at 02:09:01PM +0900, KAMEZAWA Hiroyuki wrote:
> > On Wed, 29 Sep 2010 07:22:06 -0500
> > Jack Steiner <steiner@xxxxxxx> wrote:
>
>
> I was able to run on the 4096p system over the weekend. The patch is a
> definite improvement & partially fixes the problem:
>
> A "cat /proc/stat >/dev/null" improved:
>
> OLD: real 12.627s
> NEW: real 2.459
>
>
Thank you.

> A large part of the remaining overhead is in the second summation
> of irq information:
>
>
> static int show_stat(struct seq_file *p, void *v)
> ...
> /* sum again ? it could be updated? */
> for_each_irq_nr(j) {
> per_irq_sum = 0;
> for_each_possible_cpu(i)
> per_irq_sum += kstat_irqs_cpu(j, i);
>
> seq_printf(p, " %u", per_irq_sum);
> }
>
> Can this be fixed using the same approach as in the current patch?
>
>

I guess this requres different approarch as per-cpu counter + threshould.
like vmstat[] or lib/percpu_counter.
Maybe people don't like to access shared counter in IRQ.

But, this seems to call radixtree-lookup for the # of possible cpus.
I guess impleimenting a call to calculate a sum of irqs in a radix-tree
lookup will reduce overhead. If it's not enough, we'll have to make the
counter not-precise. I'll write an another patch.


Thanks,
-Kame

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