Messages in this thread | | | Date | Wed, 1 Jul 2009 15:50:34 +0200 | From | Andi Kleen <> | Subject | Re: [PATCH][RFC] Adding information of counts processes acquired how many spinlocks to schedstat II |
| |
On Wed, Jul 01, 2009 at 11:07:49AM +0200, Ingo Molnar wrote: > His arguments are bogus: both lockstat and perfcounters are optional > (and default off), and the sw counter can be made near zero cost > even if both perfcounters and lockstat is enabled. Also, sw counters > are generally per CPU, etc. so not a performance issue.
BTW I looked through the code generated by this again. As far as I can see it still uses a global flag word to enable/disable the counter.
The standard problem -- discussed a lot -- with that set up used to be that if the kernel is entered cache cold then you end up with a potential full cache miss (200-1000 cycles) just to access that global variable. The old LTT had a neat optimization to patch in immediate values to avoid this problem.
Has this been considered for these counters? With such a change it might be indeed a "small" cost even in the worst cases.
-Andi
-- ak@linux.intel.com -- Speaking for myself only.
| |