Linux Perf Users
 help / color / mirror / Atom feed
* measuring L3cache misses
@ 2012-06-21  7:36 Hank
  2012-06-21 12:25 ` Vince Weaver
  0 siblings, 1 reply; 5+ messages in thread
From: Hank @ 2012-06-21  7:36 UTC (permalink / raw)
  To: linux-perf-users

Hi,
I'm measuring L1-L2-L3 cache misses on AMD Magnycours server. 
I'm getting very high numbers for L3-miss numbers in comparison to L2-misses. 
In some cases L3misses are 30times higher than L2misses. 
Theoretically L1miss>L2miss>L3miss. 
Anyone have any idea what might be the reason for this? 

thanks

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: measuring L3cache misses
  2012-06-21  7:36 measuring L3cache misses Hank
@ 2012-06-21 12:25 ` Vince Weaver
       [not found]   ` <CAMmbtvK-78Xgvby-VOyVHEf7LbRD8=vw5b7ziOvpn2KUrZm+BQ@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Vince Weaver @ 2012-06-21 12:25 UTC (permalink / raw)
  To: Hank; +Cc: linux-perf-users

On Thu, 21 Jun 2012, Hank wrote:

> I'm measuring L1-L2-L3 cache misses on AMD Magnycours server. 
> I'm getting very high numbers for L3-miss numbers in comparison to L2-misses. 
> In some cases L3misses are 30times higher than L2misses. 

> Theoretically L1miss>L2miss>L3miss. 

That's not always true, for a variety of boring computer architecture 
reasons.  

Is your system idle?  L3 cache is a shared resource so you'll be seeing 
L3 misses from all cores running on your CPU.  It's not really possible
to know what's going on without knowing more about your workload.

The other thing you can do is find out what event your kernel is using for 
L3 cache misses, and then look up the event in the appropriate AMD BKDG 
and see what it says about the event.

Vince

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: measuring L3cache misses
       [not found]   ` <CAMmbtvK-78Xgvby-VOyVHEf7LbRD8=vw5b7ziOvpn2KUrZm+BQ@mail.gmail.com>
@ 2012-06-21 16:12     ` Vince Weaver
  2012-06-21 16:41     ` Vince Weaver
  1 sibling, 0 replies; 5+ messages in thread
From: Vince Weaver @ 2012-06-21 16:12 UTC (permalink / raw)
  To: Can Hankendi; +Cc: linux-perf-users



On Thu, 21 Jun 2012, Can Hankendi wrote:

> i'm running benchmarks from PARSEC suite. The event I'm using is f74e1,
> which basically collects cache misses for any of the 6 cores, although there
> are 12 cores on my system. So, collecting per-core cache-misses doesn't mean
> anything for that specific event?

You should check out the "Revision Guide for AMD Family 10h Processors".
The one that most likely applies is #437:
  L3 Cache Performance Events May Not Reliably Track Processor Core
#387 might be relevant too.

> Can you elaborate on some of those 'boring' computer architecture reasons?

Besides the problem of chip errata, cache events are notoriously bad at 
giving "expected" results.

Caches being include/exclusive can mean that cache levels are skipped when
doing lookups.

Victim caches can also change the results.

Some caches include cache coherency requests in their miss rates even if 
no actual miss happens.

Some events include results from prefetching as hits or misses.  It's not 
always clear from the documentation.

Most companies do not provide detailed enough descriptions of their cache 
infrastructures to generate accurate models of what the expected cache 
behavior should be.

Vince

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: measuring L3cache misses
       [not found]   ` <CAMmbtvK-78Xgvby-VOyVHEf7LbRD8=vw5b7ziOvpn2KUrZm+BQ@mail.gmail.com>
  2012-06-21 16:12     ` Vince Weaver
@ 2012-06-21 16:41     ` Vince Weaver
       [not found]       ` <CAMmbtvJ0iijBkF58+qJ_UBHDOQ4YNRW2Gc7xE=rvR1qXxfweBg@mail.gmail.com>
  1 sibling, 1 reply; 5+ messages in thread
From: Vince Weaver @ 2012-06-21 16:41 UTC (permalink / raw)
  To: Can Hankendi; +Cc: linux-perf-users

On Thu, 21 Jun 2012, Can Hankendi wrote:

> i'm running benchmarks from PARSEC suite. The event I'm using is f74e1,
> which basically collects cache misses for any of the 6 cores, although there
> are 12 cores on my system. So, collecting per-core cache-misses doesn't mean
> anything for that specific event?

also, how are you specifying event f74e1?

I assume you know the 4 goes at the top, so that the event you pass to 
perf would look somehing like this:
   r40053f7e1

Vince

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: measuring L3cache misses
       [not found]       ` <CAMmbtvJ0iijBkF58+qJ_UBHDOQ4YNRW2Gc7xE=rvR1qXxfweBg@mail.gmail.com>
@ 2012-06-21 21:38         ` Vince Weaver
  0 siblings, 0 replies; 5+ messages in thread
From: Vince Weaver @ 2012-06-21 21:38 UTC (permalink / raw)
  To: Can Hankendi; +Cc: linux-perf-users

[-- Attachment #1: Type: text/plain, Size: 516 bytes --]

On Thu, 21 Jun 2012, Can Hankendi wrote:

> I'm not aware of that coding, can you explain more? However if check Basic
> Performance Measurements for AMD Athlon ... - AMD Developer, f74e1 seems to
> be the correct register. What do you think?

how exactly are you calling perf?  What command line are you using?

I'd reccommend you use libpfm4 to create your perf_event raw event values, 
otherwise you are just measuring arbitrary values.  There's no error 
checking in the perf raw event case.

Vince

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-06-21 21:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-21  7:36 measuring L3cache misses Hank
2012-06-21 12:25 ` Vince Weaver
     [not found]   ` <CAMmbtvK-78Xgvby-VOyVHEf7LbRD8=vw5b7ziOvpn2KUrZm+BQ@mail.gmail.com>
2012-06-21 16:12     ` Vince Weaver
2012-06-21 16:41     ` Vince Weaver
     [not found]       ` <CAMmbtvJ0iijBkF58+qJ_UBHDOQ4YNRW2Gc7xE=rvR1qXxfweBg@mail.gmail.com>
2012-06-21 21:38         ` Vince Weaver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox