tech-kern archive

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

Re: per-cpu statistics (Re: CVS commit: src)

On Apr 10, 2008, at 10:36 PM, Simon Burge wrote:

I'm happy with keeping the API too.  Is the longer term plan to make
_all_ evcnts (kstats/counters/whatever) per-CPU?  At collate at user
access time?

I think there will be two classes, at least:

- Strictly per-CPU (no collating ... for stuff like "cpu0 intr count", etc.)

- Global with per-CPU updates, collated at user access time

And *MAYBE*:

- Global with interlocked updates.

The class should simply be declared when the evcnt is attached, and the API handles all of the details. evcnts should cease being accessed directly by code that increments them; they should call into the API to manipulate the count.

I'd really prefer to not have the third class (interlocked global) because it just has crappy MP scalability, but might be OK for counters that are not modified very often. On platforms with 64-bit atomic ops, it might not be TOO bad (still have the false sharing problem, but that's it), but other platforms would require a mutex to be held to update the counter.


-- thorpej

Home | Main Index | Thread Index | Old Index