From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753679AbcHQGsL (ORCPT ); Wed, 17 Aug 2016 02:48:11 -0400 Received: from merlin.infradead.org ([205.233.59.134]:38294 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750763AbcHQGsL (ORCPT ); Wed, 17 Aug 2016 02:48:11 -0400 Date: Wed, 17 Aug 2016 08:48:00 +0200 From: Peter Zijlstra To: "H. Peter Anvin" Cc: Borislav Petkov , kernel test robot , Ville Syrj?l? , Linus Torvalds , Andy Lutomirski , Brian Gerst , Denys Vlasenko , Thomas Gleixner , Ingo Molnar , LKML , lkp@01.org Subject: Re: [lkp] [x86/hweight] 65ea11ec6a: will-it-scale.per_process_ops 9.3% improvement Message-ID: <20160817064800.GN30192@twins.programming.kicks-ass.net> References: <20160816142642.GA24206@yexl-desktop> <9FF32F53-5EF8-40D4-B696-A30FDF7201E1@zytor.com> <20160816171635.GA10542@nazgul.tnic> <796A2A72-06B7-4B3D-AA38-DF558FC75857@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <796A2A72-06B7-4B3D-AA38-DF558FC75857@zytor.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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... From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============4019807165781876444==" MIME-Version: 1.0 From: Peter Zijlstra To: lkp@lists.01.org Subject: Re: [x86/hweight] 65ea11ec6a: will-it-scale.per_process_ops 9.3% improvement Date: Wed, 17 Aug 2016 08:48:00 +0200 Message-ID: <20160817064800.GN30192@twins.programming.kicks-ass.net> In-Reply-To: <796A2A72-06B7-4B3D-AA38-DF558FC75857@zytor.com> List-Id: --===============4019807165781876444== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 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... --===============4019807165781876444==--