From: Ingo Molnar <mingo@elte.hu>
To: Paul Mackerras <paulus@samba.org>
Cc: Robert Richter <robert.richter@amd.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org, Mike Galbraith <efault@gmx.de>
Subject: Re: round-robining per-cpu counters
Date: Tue, 5 May 2009 15:49:43 +0200 [thread overview]
Message-ID: <20090505134943.GA19122@elte.hu> (raw)
In-Reply-To: <18944.10637.877638.642187@cargo.ozlabs.ibm.com>
* 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
prev parent reply other threads:[~2009-05-05 13:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-05 3:58 round-robining per-cpu counters Paul Mackerras
2009-05-05 6:40 ` Ingo Molnar
2009-05-05 11:57 ` Paul Mackerras
2009-05-05 13:49 ` Ingo Molnar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090505134943.GA19122@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.org \
--cc=robert.richter@amd.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox