Re: [RFC] [PATCH] Scalable Statistics Counters

From: Rusty Russell (
Date: Sat Dec 08 2001 - 02:38:09 EST

In message <> you write:
> On Thu, Dec 06, 2001 at 02:18:26PM +1100, Rusty Russell wrote:
> > On Wed, 05 Dec 2001 12:08:57 -0800
> > Andrew Morton <> wrote:
> >
> > >
> >
> > Oops, guess I should have read this thread first (still catching up on mail
> >
> > Please see my per-cpu patch (just posted under [PATCH] 2.5.1-pre5: per-cpu
> > areas), and my previous /proc patch. Combining the two into convenient for
> > is left as an exercise for the reader...
> Hi Rusty,
> Your per-cpu area patch looks like a good solution with a very simple
> implementation. BTW, some OSes map the per-cpu data areas
> to the same virtual address for each CPU avoiding the per-cpu data
> array lookup. I am not sure if this really saves much, we are ourselves
> trying to understand the overhead of such array lookup with
> statctrs.

I'd be interested in the results: it'd certainly be neater. Another
option would be to use the per-cpu region pointer where architectures
currently hold smp_processor_id(), and derive the current CPU from the
per-CPU area instead of vice versa.

> IIUC, we can declare statically allocated per-cpu data using
> this allocator (kstat, apic_timer_irqs etc.). For things that
> are a part of dynamically allocated structure, we would still
> need to use a dynamic per-cpu allocator, right ?

Yep... Someone Else's Problem 8)

> Another interesting question is how we can load different
> per-cpu sections to different areas in memory. I would suspect
> that for NUMA, we would want to locate the per-cpu sections closest
> to the corresponding CPUs.

It could possibly be done with linker tricks in, and yes,
definitely worth doing.

> I couldn't find the /proc patch. Any pointers ?

Hmm... I'm working on a rewrite, but the interface should stay the


  Anyone who quotes me is an idiot. -- Rusty Russell.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sat Dec 15 2001 - 21:00:12 EST