LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andi Kleen <ak@muc.de>
To: "Bryan O'Sullivan" <bos@serpentine.com>
Cc: Andi Kleen <ak@muc.de>, Mikael Pettersson <mikpe@csd.uu.se>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH][3/7] perfctr-2.7.2 for 2.6.6-mm2: x86_64
Date: 15 May 2004 11:09:11 +0200	[thread overview]
Date: Sat, 15 May 2004 11:09:11 +0200	[thread overview]
Message-ID: <20040515090911.GA21406@colin2.muc.de> (raw)
In-Reply-To: <1084599456.4895.103.camel@obsidian.pathscale.com>

On Fri, May 14, 2004 at 10:37:36PM -0700, Bryan O'Sullivan wrote:
> On Fri, 2004-05-14 at 08:14, Andi Kleen wrote:
> 
> > Before merging all that I would definitely recommend some generic
> > module to allocate performance counters. IBM had a patch for this
> > long ago, and it is even more needed now.
> 
> That's currently handled in user space, by PAPI (which sits on top of
> perfctr).  One reason *not* to do it in the kernel is the bloat it would

That's clearly the wrong place to do it.

> entail; just look at the horrendous mess that is the P4 performance
> counter event selector.

There is no way around that - there are kernel users (like the
nmi watchdog or oprofile) and kernel users cannot be made dependent 
on user space modules. Also I think managing of hardware resources is the 
primary task of a kernel, nothing that should be delegated to user 
space.

The netburst mess can be probably abstracted just into more counters.
The kernel doesn't need to know everything about them, just roughly
how many independent counters there are.

> 
> > Why do you check for K8 C stepping? I don't see any code that
> > does anything special with that.
> 
> The reason it's interesting at all is that it's the first K8 stepping
> that introduces new performance counter unit masks.  The kernel driver
> already passes its notion of what the CPU type is up to userspace. 
> (Clearly, userspace could figure this out, since it's just parsing the
> cpuid instruction.)
> 
> It also checks the CPU type in a few places internally; it just doesn't
> happen to care internally about K8 stepping C.  Thoroughness?

Why does the library caring about that not just read /proc/cpuinfo
to find out?

I sense pointless duplication of mechanism.

-Andi

  reply	other threads:[~2004-05-15  9:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1VLRr-38z-19@gated-at.bofh.it>
2004-05-14 15:14 ` Andi Kleen
2004-05-15  5:37   ` Bryan O'Sullivan
2004-05-15  9:09     ` Andi Kleen [this message]
2004-05-16  4:15       ` Bryan O'Sullivan
2004-05-16  9:58 Mikael Pettersson
  -- strict thread matches above, loose matches on Subject: below --
2004-05-15 14:44 Mikael Pettersson
2004-05-15 19:26 ` Andi Kleen
2004-05-15 14:42 Mikael Pettersson
2004-05-15 19:16 ` Andi Kleen
2004-05-15 20:40   ` John Reiser
2004-05-15 20:49     ` Andi Kleen
2004-05-14 14:11 Mikael Pettersson

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=20040515090911.GA21406@colin2.muc.de \
    --to=ak@muc.de \
    --cc=bos@serpentine.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikpe@csd.uu.se \
    --subject='Re: [PATCH][3/7] perfctr-2.7.2 for 2.6.6-mm2: x86_64' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).