mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Stephane Eranian <eranian@google.com>
Cc: Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
	ming.m.lin@intel.com, peterz@infradead.org
Subject: Re: [rfc 1/3] perf, x86: P4 PMU - describe config format
Date: Fri, 26 Nov 2010 20:16:42 +0300	[thread overview]
Message-ID: <20101126171642.GB5620@lenovo> (raw)
In-Reply-To: <AANLkTikezMvVLD5vkB6OuLtPOMF1JZRyai09uhoWu=0n@mail.gmail.com>

On Fri, Nov 26, 2010 at 05:22:51PM +0100, Stephane Eranian wrote:
> On Fri, Nov 26, 2010 at 4:27 PM, Cyrill Gorcunov <gorcunov@gmail.com> wrote:
> > On Fri, Nov 26, 2010 at 02:54:39PM +0100, Stephane Eranian wrote:
> > ...
> >> >
> >> > No, single thread mode means _any_ single thread is running,
> >> > Stephane I'll describe some more a bit later (as only reach home),
> >> > ok?
> >>
> >> From the manual:
> >>
> >> 00 — None. Count only when neither logical processor is active.
> >> 01 — Single. Count only when one logical processor is active (either 0 or 1).
> >> 10 — Both. Count only when both logical processors are active.
> >> 11 — Any. Count when either logical processor is active.
> >>
> >> In per-thread mode, you won't hit 00. I suspect you want to
> >> disallow 01, 10 (or CAP_SYS_ADMIN). Otherwise, you want
> >> to force 11, i.e., can't figure out what's going on in the other
> >> HT thread.
> >>
> >
> >  No ;) The key moment here that this flags are related to _activity_ of
> > logical thread and I guess they were introduced just to allow measuring
> > if user-space application does win from using HT or not (since for
> > some loads the HT simply drops the perfomance).
> >
> 
> I think what they call 'logical CPU' is what the kernel calls CPU.

yes

> So I think bits 16-17 are used if you want to measure on CPU0 only
> when CPU1 (assume both share the same physical core) is active
> or inactive or don't care. You're right that I believe this mode was
> introduced to measure the level of concurrency between HT
> thread (logical CPUs).

but "single thread mode" measures the event if *any* thread
is active at a time, if we would assume that your assumption
is right -- there would be no need for T1_OS/T1_USR.

So I must admit I'm confused, the Oprofile do things simplier --
it just sets "thread any" ;)

> 
> In architectural perfmon the .any modifier is slightly different.
> It indicates whether you want to measure only yourself or both
> threads (regardless of the state of the other HT thread). In other
> words, it is not because .any=1 that the event counts ONLY when
> both threads (logical CPUs) are active.
> 
...

 Stephane, could you do a test? We need a pinned event which would be
running on say cpu0 only and if you set P4_CCCR_THREAD_SINGLE in CCCR
and event would be still incrementing -- this mean my theory is correct
and this "thread" field means "when" to count, if not -- you're right
and "thread" field means "where" instead.

  Cyrill

  reply	other threads:[~2010-11-26 17:16 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-23 22:46 [rfc 0/3] perf,x86: p4 pmu series Cyrill Gorcunov
2010-11-23 22:46 ` [rfc 1/3] perf, x86: P4 PMU - describe config format Cyrill Gorcunov
2010-11-26 10:57   ` Stephane Eranian
2010-11-26 11:14     ` Cyrill Gorcunov
2010-11-26 11:32       ` Cyrill Gorcunov
2010-11-26 11:35         ` Stephane Eranian
2010-11-26 11:58           ` Cyrill Gorcunov
2010-11-26 12:46             ` Stephane Eranian
2010-11-26 13:04               ` Cyrill Gorcunov
2010-11-26 13:06                 ` Peter Zijlstra
2010-11-26 13:47                   ` Cyrill Gorcunov
2010-11-26 13:10                 ` Stephane Eranian
2010-11-26 13:50                   ` Cyrill Gorcunov
2010-11-26 13:54                     ` Stephane Eranian
2010-11-26 15:27                       ` Cyrill Gorcunov
2010-11-26 16:22                         ` Stephane Eranian
2010-11-26 17:16                           ` Cyrill Gorcunov [this message]
2010-11-26 18:05                             ` Stephane Eranian
2010-11-26 20:11                               ` Cyrill Gorcunov
2010-11-26 12:48   ` Stephane Eranian
2010-11-26 12:59     ` Peter Zijlstra
2010-11-26 13:07       ` Stephane Eranian
2010-11-26 13:07       ` Cyrill Gorcunov
2010-11-23 22:46 ` [rfc 2/3] perf, x86: P4 PMU - Fix unflagged overflows handling v4 Cyrill Gorcunov
2010-11-23 22:46 ` [rfc 3/3] perf, x86: P4 PMU -- export ABI part of event config to userspace Cyrill Gorcunov
2010-11-24  8:32   ` Peter Zijlstra
2010-11-24  8:48     ` Cyrill Gorcunov
2010-11-24  9:02       ` Peter Zijlstra
2010-11-24  9:39         ` Cyrill Gorcunov
2010-11-24 11:46           ` Cyrill Gorcunov

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=20101126171642.GB5620@lenovo \
    --to=gorcunov@gmail.com \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.m.lin@intel.com \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    /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®