Messages in this thread | | | Date | Tue, 5 May 2009 15:49:43 +0200 | From | Ingo Molnar <> | Subject | Re: round-robining per-cpu counters |
| |
* Paul Mackerras <paulus@samba.org> wrote:
> > I think a better general solution would be to have a single > > round-robin list for all currently active counters (both percpu > > and task counters) - and fairly round-robin all of them. The > > scaling information makes it obvious when this is happening. > > Sounds good, but I'm having trouble visualizing how we combine a > fairly static set of per-cpu counters with several sets of > per-task counters that come and go as their tasks get scheduled in > and out. Is there some clever scheduling technique that sorts all > that out?
Fair scheduling techniques would import the complexity of kernel/sched*.c into kernel/perf_counter.c - not sure we want that (at this stage at least).
So i'd go for the second best option: the simplest one.
One simple option would be to 'interleave' the two lists on sched-in (take a counter from one list, then from the other, then from the first, etc.), combined with the alternate rotation of both lists.
Another, perhaps even simpler option would be to do the alternation on a per list basis: rotate which of the two lists go first on sched-in, from the task tick.
Can you see any showstopper artifacts in this scheme?
Later on, if anyone finds this method lacking it can be improved gradually either by making the accounting/statistics smarter, or by increasing the frequency of rotation events and coupling it not to the scheduler tick but to a counter perhaps.
Ingo
| |