linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Francis Moreau <francis.moro-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Reid Kleckner <reid.kleckner-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Vince Weaver <vweaver1-qKp7vQ+Mknf2fBVCVOL8/A@public.gmane.org>,
	Victor Jimenez <victor.javier-DuYNTNMygGQ@public.gmane.org>,
	Frederic Weisbecker
	<fweisbec-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Ingo Molnar <mingo-X9Un+BFzKDI@public.gmane.org>,
	Peter Zijlstra
	<a.p.zijlstra-/NLkJaSkS4VmR6Xm/wNWPw@public.gmane.org>,
	Arnaldo Carvalho de Melo
	<acme-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Stephane Eranian
	<eranian-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	linux-perf-users-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: perf tools miscellaneous questions
Date: Tue, 09 Nov 2010 16:22:31 +0100	[thread overview]
Message-ID: <m239rav7wo.fsf@gmail.com> (raw)
In-Reply-To: <AANLkTimyzO7_MzRs0tUaWFHWEN69MRhwQL=EPFiukXci-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> (Reid Kleckner's message of "Mon, 8 Nov 2010 15:06:51 -0500")

Reid Kleckner <reid.kleckner-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

[...]

> I don't know what level of cache the generic cache-misses and
> -references refer to on your processor.  Unfortunately, you'd have to
> go look up the source code and cross reference it with a manual to
> know for 100%.

Looking at the source and intel processor manual, 'cache-misses' event
is a "Pre-defined Architectural Performance Events" with:

   - UMASK = 0x41
   - Event select = 0x2e

Here's the complete definition of 'cache-misses':

   Last Level Cache Misses — Event select 2EH, Umask 41H

   This event counts each cache miss condition for references to the
   last level cache.  The event count may include speculation, but
   excludes cache line fills due to hardware-prefetch.

   Because cache hierarchy, cache sizes and other
   implementation-specific characteristics; value comparison to estimate
   performance differences is not recommended.


Also "Pre-defined Architectural Performance Events" means, that's
the definition is common across all Intel CPUs, IIUC.

> Having looked at the code, I can assert that it's an event that has to
> do with the higher level caches, ie not L1, and apparently it's not
> LLC on your machine.

Unfortunately 'cache-misses' _is_ LLC on this machine hence my
confusion with my previous examples using true(1), and gzip(1).

But to add more confusion please see the numbers below...

> IMO it's worth doing multiple runs to look at *all* of the cache
> counters on a variety of workloads with known cache behavior so you
> can get an understanding.

Here's a more complete run.

method 1:
             408502  cache-misses
            3040439  cache-references
           38489028  L1-dcache-loads
            6616736  L1-dcache-stores
            4948739  L1-dcache-load-misses
                241  L1-dcache-store-misses
            2998011  LLC-loads
             406115  LLC-load-misses
                171  LLC-stores
                 41  LLC-store-misses
          120654728  cycles
           82578853  instructions             #      0.684 IPC
                  0  minor-faults
                  0  major-faults
                  0  alignment-faults

method 2:
             460273  cache-misses
            1891362  cache-references
           28549238  L1-dcache-loads
            6596346  L1-dcache-stores
            3699561  L1-dcache-load-misses
                608  L1-dcache-store-misses
            1884987  LLC-loads
             459826  LLC-load-misses
                 63  LLC-stores
                 38  LLC-store-misses
          160426298  cycles
           87272047  instructions             #      0.544 IPC  
                  0  minor-faults
                  0  major-faults
                  0  alignment-faults

Now 'cache-misses' and 'LLC-{load,store}-misses' are quite similar,
sigh...

So the first method since more efficient because it seems to execute
less instructions and have less LLC misses even if its L1-dcache misses
is lower.

Thanks
-- 
Francis

  parent reply	other threads:[~2010-11-09 15:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fa.SSgtQesEhEQa5DUYUwBV3fWtoV4@ifi.uio.no>
     [not found] ` <fa.dD5ur5Phqa1TLmYBE2NVKCQMjTw@ifi.uio.no>
     [not found]   ` <fa.Xj1lA7n6nIJYL40CeRDpQzSKlfc@ifi.uio.no>
     [not found]     ` <fa.xcyA+VzIXesq6qsPU6ADM4xdCKY@ifi.uio.no>
     [not found]       ` <fa.MOg61Pcfdp2SJnwM2GFdOxP+xt0@ifi.uio.no>
     [not found]         ` <fa.4sHfhlc/fMhpYgKda4IfUHZ7jMY@ifi.uio.no>
     [not found]           ` <m2wros3pzf.fsf@gmail.com>
     [not found]             ` <alpine.DEB.2.00.1011051000310.26020@cl320.eecs.utk.edu>
     [not found]               ` <m262wao6k7.fsf@gmail.com>
     [not found]                 ` <m262wao6k7.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-06 20:50                   ` perf tools miscellaneous questions Vince Weaver
     [not found]                     ` <alpine.DEB.2.00.1011061642020.29635-h+XK9Y6koVLPD5dMldXnqTe48wsgrGvP@public.gmane.org>
2010-11-06 20:52                       ` Vince Weaver
2010-11-08 19:43                       ` Francis Moreau
     [not found]                         ` <m24obr1tzf.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-08 20:06                           ` Reid Kleckner
     [not found]                             ` <AANLkTimyzO7_MzRs0tUaWFHWEN69MRhwQL=EPFiukXci-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-09 15:22                               ` Francis Moreau [this message]
     [not found] <fa.yHA7Aw03llqLWxPVYRnHvK5/dT8@ifi.uio.no>
     [not found] ` <fa.13KEqWk+Dk+jLLdFlAoZtQ2Vjuw@ifi.uio.no>
     [not found]   ` <m2lj59sc7a.fsf@gmail.com>
     [not found]     ` <m2lj59sc7a.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-07 21:40       ` Frederic Weisbecker
2010-11-09 11:07         ` Francis Moreau

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=m239rav7wo.fsf@gmail.com \
    --to=francis.moro-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=a.p.zijlstra-/NLkJaSkS4VmR6Xm/wNWPw@public.gmane.org \
    --cc=acme-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=eranian-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=fweisbec-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-perf-users-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mingo-X9Un+BFzKDI@public.gmane.org \
    --cc=reid.kleckner-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=victor.javier-DuYNTNMygGQ@public.gmane.org \
    --cc=vweaver1-qKp7vQ+Mknf2fBVCVOL8/A@public.gmane.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;
as well as URLs for NNTP newsgroup(s).