From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751890AbeFEPrh (ORCPT ); Tue, 5 Jun 2018 11:47:37 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:54355 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751282AbeFEPrg (ORCPT ); Tue, 5 Jun 2018 11:47:36 -0400 X-Google-Smtp-Source: ADUXVKIK3sB8N9FV1sjZBIkPjmqYN3phNP5ESS9L/L3TvO/clg0U0t5TAoIwbkdK78alZWlE9SSLU/770Q/Hznzn+qM= MIME-Version: 1.0 References: <20180604122132.GA3337@gmail.com> <20180605150514.GA31065@gmail.com> In-Reply-To: <20180605150514.GA31065@gmail.com> From: Linus Torvalds Date: Tue, 5 Jun 2018 08:47:24 -0700 Message-ID: Subject: Re: x86/asm: __clear_user() micro-optimization (was: "Re: [GIT PULL] x86/asm changes for v4.18") To: Ingo Molnar Cc: Alexey Dobriyan , Linux Kernel Mailing List , Thomas Gleixner , Peter Zijlstra , Andrew Morton , Andrew Lutomirski , Borislav Petkov , Josh Poimboeuf , Peter Anvin , Denys Vlasenko Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 5, 2018 at 8:05 AM Ingo Molnar wrote: > > Ok, fair point and agreed - if Alexey sends some measurements to back the change > I'll keep this, otherwise queue up a revert. I don't think it needs to be reverted, it's not like it's likely to hurt on any modern CPU's. The issues I talked about are fairly historical - barely even 64-bit cpus - and I'm not sure an extra uop to carry a constant around even matters in that code sequence. It was more a generic issue - any micro-optimization should be based on numbers (and there should be some numbers in the commit message), not on "this should be faster". Because while intuitively immediates _should_ be faster than registers, that's simply not always "obviously true". It _may_ be true. But numbers talk. Linus