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, 16 Sep 2013 01:17:45 -0500
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Peter Zijlstra <peterz@...radead.org>
CC:	Andi Kleen <andi@...stfloor.org>, mingo@...nel.org,
	linux-kernel@...r.kernel.org, tglx@...utronix.de,
	linux-tip-commits@...r.kernel.org
Subject: Re: [tip:perf/core] perf/x86/intel: Clean-up/reduce PEBS code

On 09/16/2013 01:07 AM, Peter Zijlstra wrote:
> On Fri, Sep 13, 2013 at 11:18:21PM -0700, Andi Kleen wrote:
>> tip-bot for Peter Zijlstra <tipbot@...or.com> writes:
>>> +
>>> +	at  = (struct pebs_record_nhm *)(unsigned long)ds->pebs_buffer_base;
>>> +	top = (struct pebs_record_nhm *)(unsigned long)ds->pebs_index;
>>>
>>>   	ds->pebs_index = ds->pebs_buffer_base;
>>>
>>> +	n = (top - at) / x86_pmu.pebs_record_size;
>>
>>
>> This adds a full slow division to the PEBS hot path.
>>
>> Does not seem like a improvement to me.
>
> There already was an implicit division there, and
> sizeof(pebs_record_hsw) = 176, can it really optimize that constant
> division?
>

gcc can optimize ANY constant division, if nothing else then by 
reciprocal multiplication.

	-hpa


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ