Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp716678imm; Thu, 4 Oct 2018 02:04:08 -0700 (PDT) X-Google-Smtp-Source: ACcGV62HHFM4C89VxQ9PuIc1BFmQn4JGZAfTIJgZ7oUXYpacY6h46mcZTA+Em7ewfFc8CFo9eM+5 X-Received: by 2002:a17:902:62:: with SMTP id 89-v6mr5610480pla.298.1538643848121; Thu, 04 Oct 2018 02:04:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538643848; cv=none; d=google.com; s=arc-20160816; b=cNwML22CUijKVcOMKhE3uXC4LtuZJPZ6uZlfttlU7Uk6e84nQI2gxIgT1N2uXnuMeT 8SEtFdKLvqy9ZrIO6JDDUfz2TDeAivgqT201rbqiLs8Ab8aNko58bgtkaL6hqwRaFQc1 HnGCO3C30zGUbegENBL4j5SYuwm/mVItXDKMdPa7UIZmiBKIlAq+A9gztKzIkUoE8ppY x9vNwxEmlcI+iL1ubat8V/KhGUyz+zz6MVgqqU4CKGblak6FZca/dXe9NoIp25ea5TkX 5lZTNLK03hBHNbTAsq/f5JOpJAmPGrolHTc4BzJ6txE5dSo+AG9aKXBkzyqQFQkZody7 p98A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date; bh=Hf/ErAU4jhGIPq+zkuZZH2H5d8zCbqDso/HZ4syPI7s=; b=dfh9gg/MvSMhp62AVqogmAQoMLxNpJNb8Pp5GtZymbz0m7U+kAD6UigxtaHKlyRGJN FhselwM3QOKHACJ4wKGSjwjatNkveh29NzO2lk8CUC7V4SV2C0QOWrAmxtRENMDpx0re ZS7Do3vcTOU1RipZBgfTO35/WF8OpG5XHQtvOjdM1hQv8lYzr7fpYwsptFafphf3WUE3 4v40P0okH/KmTkxEDF6j78SlfS9WqerwQr4udMt5lVDZ9jIDMveHNAEph2AbQkEbKlTn SqtYc/2XEEAXIV60tIjQ+NvT1d/x8izbhJi1RbbJaJ53kMPlIbX9iTy1ONfhkPFOMBto DlEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z138-v6si5224161pfc.181.2018.10.04.02.03.52; Thu, 04 Oct 2018 02:04:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727609AbeJDPz0 convert rfc822-to-8bit (ORCPT + 99 others); Thu, 4 Oct 2018 11:55:26 -0400 Received: from terminus.zytor.com ([198.137.202.136]:47819 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727150AbeJDPz0 (ORCPT ); Thu, 4 Oct 2018 11:55:26 -0400 Received: from wld62.hos.anvin.org (c-24-5-245-234.hsd1.ca.comcast.net [24.5.245.234] (may be forged)) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id w9492vxA2684371 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 4 Oct 2018 02:02:58 -0700 Date: Thu, 04 Oct 2018 02:02:51 -0700 User-Agent: K-9 Mail for Android In-Reply-To: References: <20181003213100.189959-1-namit@vmware.com> <20181003213100.189959-5-namit@vmware.com> <20181004075755.GA3353@gmail.com> <20181004083333.GA9802@gmail.com> <10D29A50-C352-4407-A824-0C3C06CD8592@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Subject: Re: [PATCH v9 04/10] x86: refcount: prevent gcc distortions To: Nadav Amit , Ingo Molnar CC: Ingo Molnar , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , Thomas Gleixner , Jan Beulich , Josh Poimboeuf , Linus Torvalds , Peter Zijlstra , Andy Lutomirski From: hpa@zytor.com Message-ID: <36D6F606-6922-4057-B1F8-2B30993962AE@zytor.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On October 4, 2018 1:56:37 AM PDT, Nadav Amit wrote: >at 1:40 AM, hpa@zytor.com wrote: > >> On October 4, 2018 1:33:33 AM PDT, Ingo Molnar >wrote: >>> * Ingo Molnar wrote: >>> >>>> I'm also somewhat annoyed at the fact that this series carries a >>> boatload >>>> of reviewed-by's and acked-by's, yet none of those reviewers found >it >>>> important to point out the large chasm that is gaping between >>> description >>>> and reality. >>> >>> Another problem I just realized is that we now include >>> arch/x86/kernel/macros.S in every >>> translation pass when building the kernel, right? >>> >>> But arch/x86/kernel/macros.S expands to a pretty large hiearchy of >>> header files: >>> >>> $ make arch/x86/kernel/macros.s >>> >>> $ cat $(grep include arch/x86/kernel/macros.s | cut -d\" -f2 | sort >| >>> uniq) | wc -l >>> 4128 >>> >>> That's 4,100 extra lines of code to be preprocessed for every >>> translation unit, of >>> which there are tens of thousands. More if other pieces of code get >>> macrofied in >>> this fasion in the future. >>> >>> If we assume that a typical distribution kernel build has ~20,000 >>> translation units >>> then this change adds 82,560,000 more lines to be preprocessed, just >to >>> work around >>> a stupid GCC bug? >>> >>> I'm totally unhappy about that. Can we do this without adding >macros.S? >>> >>> It's also a pretty stupidly central file anyway that moves source >code >>> away >>> from where it's used. >>> >>> Thanks, >>> >>> Ingo >> >> It's not just for working around a stupid GCC bug, but it also has a >huge >> potential for cleaning up the inline asm in general. >> >> I would like to know if there is an actual number for the build >overhead >> (an actual benchmark); I have asked for that once already. > >I can run some tests. (@hpa: I thought you asked about the -pipe >overhead; >perhaps I misunderstood). > >I guess you regard to the preprocessing of the assembler. Note that the >C >preprocessing of macros.S obviously happens only once. That’s the >reason >I assumed it’s not that expensive. > >Anyhow, I remember that we discussed at some point doing something like >‘asm(“.include XXX.s”)’ and somebody said it is not good, but I don’t >remember why and don’t see any reason it is so. Unless I am missing >something, I think it is possible to take each individual header and >preprocess the assembly part of into a separate .s file. Then we can >put in >the C part of the header ‘asm(".include XXX.s”)’. > >What do you think? Ingo: I wasn't talking necessarily about the specifics of each bit, but rather the general concept about being able to use macros in inlines... I can send you something I have been working on in the background, but have been holding off on because of this, in the morning my time. But that's no excuse for not doing it right. Global asm() statements are problematic because there is no guarantee where in the assembly source they will end up. You'd almost need to intercept the assembly output, move all the includes to the top, and then process... -- Sent from my Android device with K-9 Mail. Please excuse my brevity.