mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Reinette Chatre <reinette.chatre@intel.com>
Cc: tglx@linutronix.de, fenghua.yu@intel.com, tony.luck@intel.com,
	mingo@redhat.com, acme@kernel.org, gavin.hindman@intel.com,
	jithu.joseph@intel.com, dave.hansen@intel.com, hpa@zytor.com,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V5 5/6] x86/intel_rdt: Use perf infrastructure for measurements
Date: Thu, 20 Sep 2018 16:11:15 +0200	[thread overview]
Message-ID: <20180920141115.GX24124@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <d31d652432a62e770fc971d3e6fe59faa9e65413.1537377064.git.reinette.chatre@intel.com>

On Wed, Sep 19, 2018 at 10:29:10AM -0700, Reinette Chatre wrote:
> +static int measure_l3_residency(void *_plr)
> +{

> +	counts.miss_after -= counts.miss_before;
> +	if (boot_cpu_data.x86_model == INTEL_FAM6_BROADWELL_X) {
> +		/*
> +		 * On BDW references and misses are counted, need to adjust.
> +		 * Sometimes the "hits" counter is a bit more than the
> +		 * references, for example, x references but x + 1 hits.
> +		 * To not report invalid hit values in this case we treat
> +		 * that as misses equal to references.
> +		 */
> +		/* First compute the number of cache references measured */
> +		counts.hits_after -= counts.hits_before;

> +		/* Next convert references to cache hits */
> +		counts.hits_after -= counts.miss_after > counts.hits_after ?
> +					counts.hits_after : counts.miss_after;

Maybe:
		counts.hits_after -= min(counts.hits_after, counts.miss_after);


  reply	other threads:[~2018-09-20 14:11 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19 17:29 [PATCH V5 0/6] perf and x86/intel_rdt: Fix lack of coordination with perf Reinette Chatre
2018-09-19 17:29 ` [PATCH V5 1/6] perf/core: Add sanity check to deal with pinned event failure Reinette Chatre
2018-09-28 20:48   ` [tip:perf/urgent] " tip-bot for Reinette Chatre
2018-09-19 17:29 ` [PATCH V5 2/6] perf/x86: Add helper to obtain performance counter index Reinette Chatre
2018-09-29  7:00   ` [tip:x86/cache] " tip-bot for Reinette Chatre
2018-09-19 17:29 ` [PATCH V5 3/6] x86/intel_rdt: Remove local register variables Reinette Chatre
2018-09-29  7:01   ` [tip:x86/cache] " tip-bot for Reinette Chatre
2018-09-19 17:29 ` [PATCH V5 4/6] x86/intel_rdt: Create required perf event attributes Reinette Chatre
2018-09-29  7:01   ` [tip:x86/cache] " tip-bot for Reinette Chatre
2018-09-19 17:29 ` [PATCH V5 5/6] x86/intel_rdt: Use perf infrastructure for measurements Reinette Chatre
2018-09-20 14:11   ` Peter Zijlstra [this message]
2018-09-20 19:02   ` [PATCH V6 " Reinette Chatre
2018-09-29  7:02     ` [tip:x86/cache] " tip-bot for Reinette Chatre
2018-09-19 17:29 ` [PATCH V5 6/6] x86/intel_rdt: Re-enable pseudo-lock measurements Reinette Chatre
2018-10-03 19:57   ` [tip:x86/cache] " tip-bot for Reinette Chatre
2018-09-20 14:11 ` [PATCH V5 0/6] perf and x86/intel_rdt: Fix lack of coordination with perf Peter Zijlstra
2018-09-21 16:49   ` Reinette Chatre
2018-09-27 20:39     ` Thomas Gleixner
2018-09-28  6:58       ` Peter Zijlstra
2018-09-29 14:23         ` Reinette Chatre
2018-09-29 17:56           ` Thomas Gleixner
2018-10-03 19:41             ` Reinette Chatre
2018-10-03 19:45               ` Thomas Gleixner

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=20180920141115.GX24124@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=dave.hansen@intel.com \
    --cc=fenghua.yu@intel.com \
    --cc=gavin.hindman@intel.com \
    --cc=hpa@zytor.com \
    --cc=jithu.joseph@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=reinette.chatre@intel.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.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

Powered by JetHome