From: Andi Kleen <ak@muc.de>
To: Mikael Pettersson <mikpe@csd.uu.se>
Cc: ak@muc.de, 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 21:16:43 +0200
Date: Sat, 15 May 2004 21:16:43 +0200 [thread overview]
Message-ID: <20040515191643.GA5748@colin2.muc.de> (raw)
In-Reply-To: <200405151442.i4FEgkjY001401@harpo.it.uu.se>
On Sat, May 15, 2004 at 04:42:46PM +0200, Mikael Pettersson wrote:
> Computing the mapping in the kernel would need lots of code, unless
> it cheats like oprofile does on the P4 and hides most counters.
> Neither hiding counters nor computing imperfect mappings is acceptable.
So how do you get oprofile and the perfctr based NMI watchdog
to cooperate? IMHO just silently breaking each other is not a good idea,
and clearly the kernel users cannot depend on user space management.
Also how does the user space management with multiple processes when
the virtual counters are disabled?
If you think doing it for individual registers is too complicated
how about a global lock? - Each application could reserve the full
perfctr bank.
This would require disabling the non IO-APIC NMI watchdog completely
when any other users are active, but that is probably tolerable.
> >+ if( perfctr_cstatus_has_tsc(cstatus) )
> >+ rdtscl(ctrs->tsc);
> >+ nrctrs = perfctr_cstatus_nractrs(cstatus);
> >+ for(i = 0; i < nrctrs; ++i) {
> >+ unsigned int pmc = state->pmc[i].map;
> >+ rdpmc_low(pmc, ctrs->pmc[i]);
> >+ }
> >
> >K8 has speculative rdtsc. Most likely you want a sync_core() somewhere
> >in there.
>
> What's the cost for sync_core()? The counts don't have to be
> perfect.
It's a CPUID to force a pipeline flush. Let's say 20-30 cycles.
-Andi
next prev parent reply other threads:[~2004-05-15 19:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-15 14:42 [PATCH][3/7] perfctr-2.7.2 for 2.6.6-mm2: x86_64 Mikael Pettersson
2004-05-15 19:16 ` Andi Kleen [this message]
2004-05-15 20:40 ` John Reiser
2004-05-15 20:49 ` Andi Kleen
-- strict thread matches above, loose matches on Subject: below --
2004-05-16 9:58 Mikael Pettersson
2004-05-15 14:44 Mikael Pettersson
2004-05-15 19:26 ` Andi Kleen
[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
2004-05-16 4:15 ` Bryan O'Sullivan
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=20040515191643.GA5748@colin2.muc.de \
--to=ak@muc.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mikpe@csd.uu.se \
/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