From: Paul Mackerras <paulus@samba.org>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Andrew Morton <akpm@linux-foundation.org>,
Stephane Eranian <eranian@googlemail.com>,
Eric Dumazet <dada1@cosmosbay.com>,
Robert Richter <robert.richter@amd.com>,
Arjan van de Ven <arjan@infradead.org>,
Peter Anvin <hpa@zytor.com>,
"David S. Miller" <davem@davemloft.net>,
perfctr-devel@lists.sourceforge.net
Subject: Re: [patch] Performance Counters for Linux, v4
Date: Wed, 17 Dec 2008 10:06:07 +1100 [thread overview]
Message-ID: <18760.13407.568536.198724@cargo.ozlabs.ibm.com> (raw)
In-Reply-To: <1229437341.7025.11.camel@twins>
Peter Zijlstra writes:
> On Mon, 2008-12-15 at 23:11 +1100, Paul Mackerras wrote:
> > I think the core should put together a list of counters and counter
> > groups that it would like to have on the PMU simultaneously and then
> > make one call to the arch layer to ask if that is possible. That
> > could either return success or failure. If it returns failure then
> > the core needs to ask for something less, or something different. I'm
> > not sure how the core should choose what to ask for instead, though.
>
> I think the constraint set should be applied when we add to a group, if
> when we add a counter to the group, the result isn't schedulable
> anymore, we should fail the group addition - and thereby the counter
> creation.
>
> This would leave us with groups that are always schedulable in an atomic
> fashion.
I agree that if adding a counter to a group results in that group not
being schedulable any more, we should fail the addition.
> >From what I understand the code RRs groups (co-scheduling groups where
> possible) (ungrouped counter is a group of one), this means that with
> the above addition you'd have the needed control over things.
>
> If you need things to be atomic, create a single group, if you're fine
> with RR time-sharing, create multiple.
I think we need a "full-time" attribute for counters and groups that
says "I need to be on the whole time", where "whole time" means
whenever the task is running, for a per-task counter or group, or
continuously for per-cpu counters/groups.
With that, the core can check at creation or enable time and return an
error if it can't fit all the full-time counters and groups on, or if
there is any part-time counter/group that would never get to go on
when all the full-time counters/groups are on. (And I guess creation
or enabling of a part-time counter or group should fail if it would
never be able to go on.)
> This seems to leave a hole where multiple monitors collide and create
> multiple groups unaware of each-other - could we plug this hole with a
> group attribute?
There could be a "whole-PMU" group attribute, that says "I need raw
access to the PMU with no other counters scheduled", which would allow
monitoring programs to use arcane PMU features that the kernel doesn't
necessarily know about. But I think that's a bit different from what
you're talking about.
The perf counter subsystem will, in Ingo's design, naturally try to
schedule as many counters and groups on as it can. Given a list of
counters/groups, it could start with the first and keep on trying to
add counters or groups while it can, essentially trying all possible
combinations until it either fills up all the hardware counters or
exhausts the possible combinations. If it moves all the
counters/groups that do fit on up to the head of the list, and then
rotates them to the back of the list when the timeslice expires, that
would probably be OK. In fact the computation about what set of
counters/groups to put on should be done when adding/removing a
counter/group and when the timeslice expires, rather than at context
switch time. (I'm talking about the list of part-time counters/groups
here, of course.)
Paul.
next prev parent reply other threads:[~2008-12-16 23:07 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-14 21:28 Ingo Molnar
2008-12-15 11:59 ` Paul Mackerras
2008-12-15 12:11 ` Paul Mackerras
2008-12-16 14:22 ` Peter Zijlstra
2008-12-16 23:06 ` Paul Mackerras [this message]
2008-12-16 23:51 ` Ingo Molnar
2008-12-17 1:55 ` Andi Kleen
2009-01-16 18:01 ` Corey Ashford
2009-01-16 22:14 ` Maynard Johnson
2009-01-16 23:11 ` Ingo Molnar
2009-01-17 1:26 ` Paul Mackerras
2009-01-17 9:53 ` Andi Kleen
2008-12-17 2:23 ` [Perfctr-devel] " Dan Terpstra
2008-12-17 7:34 ` stephane eranian
2008-12-15 17:44 ` Vince Weaver
2008-12-15 21:07 ` Vince Weaver
2008-12-15 22:13 ` Paul Mackerras
2008-12-15 21:42 ` Paul Mackerras
2008-12-15 22:03 ` stephane eranian
2008-12-16 14:42 ` Peter Zijlstra
2008-12-16 16:55 ` Vince Weaver
2008-12-16 21:52 ` Paul Mackerras
2008-12-16 12:22 ` Pavel Machek
2008-12-16 12:50 ` Ingo Molnar
2008-12-16 12:57 ` Pavel Machek
2008-12-16 13:03 ` Ingo Molnar
2008-12-16 13:13 ` Arjan van de Ven
2008-12-16 20:04 ` Pavel Machek
2008-12-16 14:45 ` Peter Zijlstra
2008-12-16 15:46 ` [Perfctr-devel] " Martin Cracauer
2008-12-16 17:38 ` Vince Weaver
2008-12-16 19:47 ` Corey Ashford
2008-12-16 20:55 ` Vince Weaver
2008-12-16 19:56 ` [Perfctr-devel] " William Cohen
2008-12-17 1:51 ` Andi Kleen
2008-12-17 1:56 ` Samuel Thibault
[not found] ` <d484eb1f0812162357n7a851f2fncc0abaae9bd293a4@mail.gmail.com>
2008-12-17 9:18 ` Andi Kleen
[not found] ` <d484eb1f0812170611s597e014cl5fb98d6dd81afd49@mail.gmail.com>
2008-12-17 15:06 ` Andi Kleen
2008-12-17 16:00 ` William Cohen
2008-12-17 20:53 ` Corey Ashford
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=18760.13407.568536.198724@cargo.ozlabs.ibm.com \
--to=paulus@samba.org \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=arjan@infradead.org \
--cc=dada1@cosmosbay.com \
--cc=davem@davemloft.net \
--cc=eranian@googlemail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=perfctr-devel@lists.sourceforge.net \
--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
all inboxes | Powered by JetHome®