From: "Jan Pokorný" <poki@redhat.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
Vince Weaver <vincent.weaver@maine.edu>,
Peter Zijlstra <peterz@infradead.org>,
linux-perf-users@vger.kernel.org
Subject: Re: perf utility question: "Sky high iTLB-load-misses"
Date: Thu, 9 Nov 2017 19:50:48 +0100 [thread overview]
Message-ID: <20171109185047.GC10004@redhat.com> (raw)
In-Reply-To: <20171109143838.GY2482@two.firstfloor.org>
[-- Attachment #1: Type: text/plain, Size: 3134 bytes --]
On 09/11/17 06:38 -0800, Andi Kleen wrote:
> On Thu, Nov 09, 2017 at 10:53:25AM -0300, Arnaldo Carvalho de Melo wrote:
>> Em Wed, Nov 08, 2017 at 11:55:02AM -0500, Vince Weaver escreveu:
>>> On Wed, 8 Nov 2017, Jan Pokorný wrote:
>>>
>>>> Is iTLB-load-misses > 100% reported because of some deficiency
>>>> of the platform, a bug in perf, or an expected behaviour?
>>>
>>> If you look into the kernel, the two events being measured are
>>> [ C(RESULT_ACCESS) ] = 0x2085, /* ITLB_MISSES.STLB_HIT */
>>> [ C(RESULT_MISS) ] = 0xe85, /* ITLB_MISSES.WALK_COMPLETED */
>>>
>>> If you look this up in Intel Vol3b you can see that the "access" metric
>>> measures First level ITLB misses that hit in the Second-level TLB
>>>
>>> Wheras the miss metric is a list of accesses from any level that caused a
>>> walk of the page tables.
>>>
>>> So the events don't necessarily sound like they match up very well, so
>>> it's beleivable you will get odd results when trying to calculate
>>> percentages based on them.
>>
>> Andi, is this something you can help in figuring out a fix? Peter?
>
> See "perf list itlb"
>
> itlb access could be replaced with instructions retired,
> but I suspect that is also not what you're looking for.
Not sure I am getting the exact events right, but there are some
results concentrating just on these 3:
$ perf stat -r 100 -e itlb_misses.stlb_hit \
-e frontend_retired.itlb_miss -e itlb_misses.walk_completed \
--log-fd=1 ./log_callsite_bench_sectionless 2>/dev/null
> [...]
> 115,178 itlb_misses.stlb_hit ( +- 2.53% )
> 46,199 frontend_retired.itlb_miss ( +- 1.93% )
> 291,411 itlb_misses.walk_completed ( +- 37.72% )
> [...]
but the ratio is flapping for particular runs, from three subsequent ones:
> 86,124 itlb_misses.stlb_hit
> 31,595 frontend_retired.itlb_miss
> 5,509 itlb_misses.walk_completed
vs.
> 97,578 itlb_misses.stlb_hit
> 33,673 frontend_retired.itlb_miss
> 15,961 itlb_misses.walk_completed
vs.
> 121,994 itlb_misses.stlb_hit
> 43,408 frontend_retired.itlb_miss
> 124,473 itlb_misses.walk_completed
I am by no mean knowledgeable in this field, didn't meant to make any real
conclusions based on the results, and I now suspect there's a reason behind
hiding iTLB-load-misses behind doubled -dd switch of the default execution
mode. Was mainly curious why such obvious outliers on this Skylake machine
were observed.
> Only other alternative would be to disable the events.
Perhaps depends on the target audience, whether it's rather amateurs like me or
hardware-literate (I mean down to archicture manuals' level) experts that can
finely reason about all these metrics :)
(Nevertheless, I think keeping the basic mode easily consumable by the former
group is a noble goal.)
--
Jan (Poki)
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2017-11-09 18:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-08 16:34 perf utility question: "Sky high iTLB-load-misses" Jan Pokorný
2017-11-08 16:55 ` Vince Weaver
2017-11-09 13:53 ` Arnaldo Carvalho de Melo
2017-11-09 14:38 ` Andi Kleen
2017-11-09 18:50 ` Jan Pokorný [this message]
2017-11-09 19:12 ` Bram Stolk
2017-11-09 19:37 ` Vince Weaver
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=20171109185047.GC10004@redhat.com \
--to=poki@redhat.com \
--cc=acme@kernel.org \
--cc=andi@firstfloor.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=vincent.weaver@maine.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.