public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Richter <robert.richter@amd.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: eranian@gmail.com, Vince Weaver <vince@deater.net>,
	Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Eric Dumazet <dada1@cosmosbay.com>,
	Arjan van de Veen <arjan@infradead.org>,
	Peter Anvin <hpa@zytor.com>, Paul Mackerras <paulus@samba.org>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [patch] Performance Counters for Linux, v3
Date: Fri, 12 Dec 2008 11:21:11 +0100	[thread overview]
Message-ID: <20081212102111.GE30490@erda.amd.com> (raw)
In-Reply-To: <1229073834.12883.41.camel@twins>

On 12.12.08 10:23:54, Peter Zijlstra wrote:
> On Fri, 2008-12-12 at 09:59 +0100, stephane eranian wrote:
> > For instance, people have pointed out that your design necessarily implies
> > pulling into the kernel the event table for all PMU models out there. This
> > is not just data, this is also complex algorithms to assign events to counters.
> > The constraints between events can be very tricky to solve. If you get this
> > wrong, this leads to silent errors, and that is really bad.
> 
> (well, its not my design - I'm just trying to see how far we can push it
> out of sheer curiosity)
> 
> This has to be done anyway, and getting it wrong in userspace is just as
> bad no? 
> 
> The _ONLY_ technical argument I've seen to do this in userspace is that
> these tables and text segments are unswappable in-kernel - which doesn't
> count too heavily in my book.

But, there are also no arguments to implement it not in userspace.

> > Looking at Intel Core, Nehalem, or AMD64 does not reflect the reality of
> > the complexity of this. Paul pointed out earlier the complexity on Power.
> > I can relate to the complexity on Itanium (I implemented all the code in
> > the user level libpfm for them).  Read the Itanium PMU description and I
> > hope you'll understand.
> 
> Again, I appreciate the fact that multi-dimensional constraint solving
> isn't easy. But any which way we turn this thing, it still needs to be
> done.

I agree with Stephane. There are already many different PMU
descriptions depending on family, model and steppping and with *every*
new cpu revision you will get one more update. Implementing this in
the kernel would require kernel updates where otherwise no changes
would be necessary.

If you look at current pmu implementations, there are tons of
descriptions files and code you don't want to have in the kernel.

Also, a profiling tool that needs a certain pmu feature would depend
then on its kernel implementation. (Actually, it is impossible to have
a 100% implementation coverage.) If the pmu could be programmed from
userspace, the tool could provide the feature itself.

> > Events constraints are not going away anytime soon, quite the contrary.
> > 
> > Furthermore, event tables are not always correct. In fact, they are
> > always bogus.
> > Event semantics varies between steppings. New events shows up, others
> > get removed.
> > Constraints are discovered later on.
> > 
> > If you have all of that in the kernel, it means you'll have to
> > generate a kernel patch each
> > time. Even if that can be encapsulated into a kernel module, you will
> > still have problems.
> 
> How is updating a kernel module (esp one that only contains constraint
> tables) more difficult than upgrading a user-space library? That just
> doesn't make sense.

At least this would require a kernel with modules enabled.

> > Furthermore, Linux commercial distribution release cycles do not
> > align well with new processor
> > releases. I can boot my RHEL5 kernel on a Nehalem system and it would
> > be  nice not to have to
> > wait for a new kernel update to get the full Nehalem PMU event table,
> > so I can program more than
> > the basic 6 architected events of Intel X86.
> 
> Talking with my community hat on, that is an artificial problem created
> by distributions, tell them to fix it.

It does not make sense to close the eyes to reality. There are systems
where it is not possible to update the kernel frequently. Probably you
have one running yourself.

-Robert

-- 
Advanced Micro Devices, Inc.
Operating System Research Center
email: robert.richter@amd.com


  reply	other threads:[~2008-12-12 10:22 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-11 15:52 [patch] Performance Counters for Linux, v3 Ingo Molnar
2008-12-11 18:02 ` Vince Weaver
2008-12-12  8:25   ` Peter Zijlstra
2008-12-12  8:35     ` stephane eranian
2008-12-12  8:51       ` Peter Zijlstra
2008-12-12  9:00         ` Peter Zijlstra
2008-12-12  9:07           ` Ingo Molnar
2008-12-12  8:59     ` stephane eranian
2008-12-12  9:23       ` Peter Zijlstra
2008-12-12 10:21         ` Robert Richter [this message]
2008-12-12 10:59           ` Christoph Hellwig
2008-12-12 11:35             ` Robert Richter
2008-12-12 16:45         ` Chris Friesen
2008-12-12 17:42         ` stephane eranian
2008-12-12 18:01           ` stephane eranian
2008-12-12 19:45             ` Chris Friesen
2008-12-15 14:50               ` stephane eranian
2008-12-15 22:32                 ` Chris Friesen
2008-12-17  7:45                   ` stephane eranian
2008-12-14 23:13             ` Ingo Molnar
2008-12-15  0:37               ` Paul Mackerras
2008-12-15 12:58                 ` stephane eranian
2008-12-15 14:42                 ` stephane eranian
2008-12-15 20:58               ` stephane eranian
2008-12-15 22:53               ` Paul Mackerras
2008-12-13 11:17           ` Peter Zijlstra
2008-12-13 13:48             ` Henrique de Moraes Holschuh
2008-12-13 17:44             ` stephane eranian
2008-12-14  1:02             ` Paul Mackerras
2008-12-14 22:37               ` Ingo Molnar
2008-12-15  0:50                 ` Paul Mackerras
2008-12-15 13:02                   ` stephane eranian
2008-12-12 17:03     ` Samuel Thibault
2008-12-12 17:11       ` Peter Zijlstra
2008-12-12 18:18     ` Vince Weaver
2008-12-11 18:35 ` Andrew Morton
2008-12-12  6:22   ` Ingo Molnar
2008-12-11 19:11 ` Tony Luck
2008-12-11 19:34   ` Ingo Molnar
2008-12-12  8:29     ` Peter Zijlstra
2008-12-12  8:54       ` Ingo Molnar
2008-12-12 13:42       ` Andi Kleen
2008-12-14 14:51 ` Performance counter API review was " Andi Kleen
2009-02-02 20:03   ` Corey Ashford
2009-02-02 20:33     ` Peter Zijlstra
2009-02-03 16:53       ` Maynard Johnson
2009-02-04  2:18       ` Paul Mackerras
2009-02-04  2:32         ` Nathan Lynch
2009-02-04  8:45         ` Peter Zijlstra
2009-02-04 10:47           ` Paul Mackerras
2009-02-04 10:51             ` Peter Zijlstra
  -- strict thread matches above, loose matches on Subject: below --
2008-12-11 22:05 William Cohen

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=20081212102111.GE30490@erda.amd.com \
    --to=robert.richter@amd.com \
    --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@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=tglx@linutronix.de \
    --cc=vince@deater.net \
    /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