Re: [lkp] [x86/hweight] 65ea11ec6a: will-it-scale.per_process_ops 9.3% improvement

From: Peter Zijlstra
Date: Wed Aug 17 2016 - 02:48:14 EST


On Tue, Aug 16, 2016 at 04:09:19PM -0700, H. Peter Anvin wrote:
> On August 16, 2016 10:16:35 AM PDT, Borislav Petkov <bp@xxxxxxx> wrote:
> >On Tue, Aug 16, 2016 at 09:59:00AM -0700, H. Peter Anvin wrote:
> >> Dang...
> >
> >Isn't 9.3% improvement a good thing(tm) ?
>
> Yes, it's huge. The only explanation I could imagine is that scrambling %rdi caused the scheduler to do completely the wrong thing.

Not entirely surprising. We have plenty bitmasks and if hweight is
corrupting the source data instead of computing the weight then we end
up having two bits of wrong information.

After that, all we can do is more wrong of course...