mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: mingo@elte.hu, eranian@google.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf, x86: Add workaround for MEM_*_RETIRED errata BV98
Date: Wed, 1 May 2013 13:12:20 +0200	[thread overview]
Message-ID: <20130501111219.GF28253@dyad.programming.kicks-ass.net> (raw)
In-Reply-To: <m261z3uipb.fsf@firstfloor.org>

On Wed, May 01, 2013 at 02:56:32AM -0700, Andi Kleen wrote:
> Peter Zijlstra <peterz@infradead.org> writes:
> >
> > So you're saying that if two SMT siblings count the same MEM_*_RETIRED event
> > (on the same counter?) events can get accounted to the wrong sibling?
> 
> It can happen regardless of what event is enabled on the other counter.

What I was trying to ask is.. where does it leak to. Does it leak to whatever
event the other counter is counting? Or does it explicitly leak to any sibilng
counter also counting MEM_*_RETIRED?

    SMT0   SMT1

C0   MR     MR
C1
C2
C3

So here SMT[01]-C0 will cross count their events.


    SMT0   SMT1

C0   MR     
C1          MR
C2
C3

Will they too here?


    SMT0   SMT1

C0   MR     Cycles
C1
C2
C3

What about here?


So again; do they specifically leak between the same counters of siblings or
between the same events of siblings. Your initial explanation wasn't clear on
when and where exactly the leak happens.


> > This begs the question what happens when the sibling does have the (same?)
> > counter enabled but counting an all together different event; do we then still
> > 'loose' events from the one sibling and add then to the other counter?
> 
> Yes, that is what the patch fixes.

Well, it very much depends on the above answer; if case-3 leaks samples from
SMT0-C0 to SMT1-C0 then the patch doesn't fix anything as the SMT1-C0 event
(cycles) doesn't bother with the shared register.



  parent reply	other threads:[~2013-05-01 11:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-29 18:45 Andi Kleen
2013-05-01  9:07 ` Peter Zijlstra
2013-05-01  9:56   ` Andi Kleen
2013-05-01 10:10     ` Ingo Molnar
2013-05-01 11:12     ` Peter Zijlstra [this message]
2013-05-01 18:13       ` Stephane Eranian
2013-05-01 19:13         ` Andi Kleen
2013-05-01 19:21           ` Stephane Eranian
2013-05-02  7:32             ` Peter Zijlstra
2013-05-06 17:41               ` Stephane Eranian
2013-05-06 19:00                 ` Peter Zijlstra

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=20130501111219.GF28253@dyad.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=andi@firstfloor.org \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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®