lkml.org 
[lkml]   [2018]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V5 5/6] x86/intel_rdt: Use perf infrastructure for measurements
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);

\
 
 \ /
  Last update: 2018-09-20 16:12    [W:0.097 / U:5.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site