lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 25 Apr 2016 22:02:22 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Vikas Shivappa <vikas.shivappa@...el.com>
Cc:	Vikas Shivappa <vikas.shivappa@...ux.intel.com>,
	tony.luck@...el.com, ravi.v.shankar@...el.com,
	fenghua.yu@...el.com, x86@...nel.org, linux-kernel@...r.kernel.org,
	hpa@...or.com, tglx@...utronix.de, mingo@...nel.org,
	h.peter.anvin@...el.com
Subject: Re: [PATCH 2/4] perf/x86/mbm: Store bytes counted for mbm during
 recycle

On Mon, Apr 25, 2016 at 11:04:38AM -0700, Vikas Shivappa wrote:
> >This is a 'creative' solution; why don't you do the normal thing, which
> >is:
> >
> >start:
> >	prev_count = read_hw_counter();
> >
> >read:
> >	do {
> >		prev = prev_count;
> >		cur_val = read_hw_counter();
> >		delta = cur_val - prev;
> >	} while (local_cmpxchg(&prev_count, prev, cur_val) != prev);
> >	count += delta;
> 
> 
> I may need to update the comment.
> 
> rc_count stores the total bytes for RMIDs that were used for this event
> except for the count of current RMID.

Yeah, I got that, eventually.

> Say an event used RMID(1) .. RMID(k) from init to read and it had RMID(k)
> when read was called, the rc_count stores the values read from RMID1 ..
> RMID(k-1).
> 
> For MBM the patch is trying to do:
> count
> = total_bytes of RMID(1) + ... +total_bytes of RMID(k-1) + total_bytes of
> RMID(k))
> = rc_count + total_bytes of RMID(k).

How is the regular counting scheme as outlined above not dealing with
this properly?

Powered by blists - more mailing lists