From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751640AbdINOsX (ORCPT ); Thu, 14 Sep 2017 10:48:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35308 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751370AbdINOsW (ORCPT ); Thu, 14 Sep 2017 10:48:22 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 577A4C047B72 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jpoimboe@redhat.com Date: Thu, 14 Sep 2017 09:48:20 -0500 From: Josh Poimboeuf To: Ingo Molnar Cc: Linus Torvalds , the arch/x86 maintainers , Linux Kernel Mailing List , Thomas Gleixner , "H. Peter Anvin" , Andy Lutomirski , Alexander Potapenko , Dmitriy Vyukov , Matthias Kaehlcke , Arnd Bergmann , Peter Zijlstra Subject: Re: [RFC PATCH 3/4] x86/asm: Make alternative macro interfaces more clear and consistent Message-ID: <20170914144820.4blzmlqeqc7unpod@treble> References: <20fac125eed15c916f684e27dfca753d524c6725.1504186968.git.jpoimboe@redhat.com> <20170831172542.k5qchwmgckdcnc6d@treble> <20170831173132.i5y5p4gdmm4iv3h3@treble> <20170902103221.5gw5vtxxknprzgdr@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20170902103221.5gw5vtxxknprzgdr@gmail.com> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 14 Sep 2017 14:48:22 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 02, 2017 at 12:32:21PM +0200, Ingo Molnar wrote: > > * Josh Poimboeuf wrote: > > > On Thu, Aug 31, 2017 at 12:25:42PM -0500, Josh Poimboeuf wrote: > > > 2) Put "sp" in the clobbers list instead of as an i/o constraint. This > > > mostly works for GCC, and doesn't break clang. However, it causes > > > GCC to insert a "lea -0x10(%rbp),%rsp" in the epilogue of every > > > affected function. > > > > And maybe this extra instruction is negligible for performance and not a > > big deal? I might look at this one after the holiday too. > > Please do statistics of how many functions are affected, on a defconfig-ish > kernel. As it turns out, the real problem with this option is that it imposes a penalty for CONFIG_FRAME_POINTER=n: even with frame pointers disabled, it forces the frame pointer to be saved for each function which uses the inline asm "call" statements. Our current solution doesn't do that. - On a defconfig-based kernel, this adds +6k of .text (+0.06%). - On a Fedora distro-based config, it adds +27k of .text (+0.3%). (I think the difference from defconfig is mostly caused by CONFIG_PARAVIRT.) I'll try a few more experiments, but I'll probably end up engaging the compiler people as Linus suggested. -- Josh