From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932186AbeFEXU2 (ORCPT ); Tue, 5 Jun 2018 19:20:28 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:33162 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932130AbeFEXU0 (ORCPT ); Tue, 5 Jun 2018 19:20:26 -0400 X-Google-Smtp-Source: ADUXVKKmlpWUrG83gpc3xMevbj20IYiMuBzTS/7h4rI/qJ03Alf2/jE1eB2Ph8vE4ocD8pLXzHVH0w== Date: Wed, 6 Jun 2018 02:20:22 +0300 From: Alexey Dobriyan To: Linus Torvalds Cc: Ingo Molnar , Linux Kernel Mailing List , Thomas Gleixner , Peter Zijlstra , Andrew Morton , Andrew Lutomirski , Borislav Petkov , Josh Poimboeuf , Peter Anvin , Denys Vlasenko Subject: Re: x86/asm: __clear_user() micro-optimization (was: "Re: [GIT PULL] x86/asm changes for v4.18") Message-ID: <20180605232022.GA4468@avx2> References: <20180604122132.GA3337@gmail.com> <20180605150514.GA31065@gmail.com> <20180605172243.GA2059@avx2> <20180605224150.GA2051@avx2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 05, 2018 at 04:04:37PM -0700, Linus Torvalds wrote: > On Tue, Jun 5, 2018 at 4:01 PM Linus Torvalds > wrote: > > > > On Tue, Jun 5, 2018 at 3:41 PM Alexey Dobriyan wrote: > > > > > > On my potato performance increase is 33%, sheesh. > > > And CPU starts doing 3 instructions per cycle vs 2. > > > > Whee. That's a shockingly big difference. On my CPU (i7-6700K) it > > makes absolutely no difference whether the values are integers or in > > registers. > > In fact, looking at Agner Fog's instruction lists, I don't see any CPU > where it would make a difference, except for the P4 (where the > immediate looks like it's a bad idea because it's an extra uop, but it > might pack fine and not be noticeable). > > But maybe I'm missing something subtle. What CPU, out of morbid interest? This is Broadwell Xeon E5-2620 v4. Which is somewhat strange indeed because it should be modern enough.