From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B391F4A1B; Sat, 28 Sep 2024 17:35:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727544935; cv=none; b=hVpk/FsRBtvLbqsLpEWeIRgMpjmihpuMB7JrMXfvl5xCw55eYmVF6vMY8hKwSNxn2ETWPkQMPXOaJJEP+RiNyoYDWz9yvfOsGpfY1Wu3uuG+gIZQieSf4MNjeo0nWspru32TwrUDEjye920wc51lZ+p7rL0Yg7cIieCI4PCi+sk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727544935; c=relaxed/simple; bh=bB2TppACa73qNvdpxzZBOI5mAq3cV8/IE4AHhZY4SiY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dDsElIhp0Vg6VnXhmMoQ9VHGPbfXJD2mzVpnU3+P92ETBkB70R6mJHOZIj0XhEOVzOY2sV87+aNeuKzolJWeLa/50nnVBISEsjZhcorEo3gAlucppiv6FWmmPH7l2swt9YynTtniXeEXy3Bow4TbglNE+nrC1+Kws2Y8/mxExlA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tJ4Msfby; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tJ4Msfby" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50CA8C4CEC3; Sat, 28 Sep 2024 17:35:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727544935; bh=bB2TppACa73qNvdpxzZBOI5mAq3cV8/IE4AHhZY4SiY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tJ4MsfbyKpA8Esh+QS3uAmaX1WGDmewgqfgYwVwy7C+UjMvu2+vUCvfK3vH3KMSR/ ZNsVAKu9T1nJjVhLY7IsxlBe87yjC3ieL7BYmwiokaxCzLA6o5co5P32q4hEwvqE+N 9aZr8yG+i38uIB6k0sU8RCPd80yhRw5X37G6jkQu+taG6EQP/oTL1QNlSzMl/XH/Mr awJ2kDI/4d8uMekYOWPzfOIlRmhqfv5LeMrrE1KxmL87cb614xDwcFMENyJFZ0ngXA aGR/AoQ2TP8GuFgSj1VSlATiM6nqScq/svAuS2jKKS+9h/AeE34k5FLpGq6rAwpq8f uIgIZQvGTAliw== Date: Sat, 28 Sep 2024 10:35:30 -0700 From: Nathan Chancellor To: Nick Desaulniers Cc: Maksim Panchenko , Rong Xu , Han Shen , Sriraman Tallam , David Li , Jonathan Corbet , Masahiro Yamada , Nicolas Schier , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , Ard Biesheuvel , Arnd Bergmann , Josh Poimboeuf , Peter Zijlstra , Bill Wendling , Justin Stitt , Vegard Nossum , John Moon , Andrew Morton , Heiko Carstens , Luis Chamberlain , Samuel Holland , Mike Rapoport , "Paul E . McKenney" , Rafael Aquini , Petr Pavlu , Eric DeVolder , Bjorn Helgaas , Randy Dunlap , Benjamin Segall , Breno Leitao , Wei Yang , Brian Gerst , Juergen Gross , Palmer Dabbelt , Alexandre Ghiti , Kees Cook , Sami Tolvanen , Xiao Wang , Jan Kiszka , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-efi@vger.kernel.org, linux-arch@vger.kernel.org, llvm@lists.linux.dev, Krzysztof Pszeniczny , Stephane Eranian , Maksim Panchenko Subject: Re: [PATCH 6/6] Add Propeller configuration for kernel build. Message-ID: <20240928173530.GC430964@thelio-3990X> References: <20240728203001.2551083-1-xur@google.com> <20240728203001.2551083-7-xur@google.com> Precedence: bulk X-Mailing-List: linux-efi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Sep 27, 2024 at 03:45:39PM -0700, Nick Desaulniers wrote: > On Thu, Sep 19, 2024 at 4:52 AM Maksim Panchenko wrote: > > > > On Sun, Jul 28, 2024 at 01:29:56PM -0700, Rong Xu wrote: > > > Add the build support for using Clang's Propeller optimizer. Like > > > AutoFDO, Propeller uses hardware sampling to gather information > > > about the frequency of execution of different code paths within a > > > binary. This information is then used to guide the compiler's > > > optimization decisions, resulting in a more efficient binary. > > > > Thank you for submitting the patches with the latest compiler features. > > > > Regarding Propeller, I want to quickly mention that I plan to send a > > patch to include BOLT as a profile-based post-link optimizer for the > > kernel. I'd like it to be considered an alternative that is selectable > > at build time. > > > > BOLT also uses sampling, and the profile can be collected on virtually > > any kernel (with some caveats). There are no constraints on the > > compiler (i.e., any version of GCC or Clang is acceptable), while Linux > > perf is the only external dependency used for profile collection and > > conversion. BOLT works on top of AutoFDO and LTO but can be used without > > them if the user desires. The build overhead is a few seconds. > > > > As you've heard from the LLVM discussion > > (https://discourse.llvm.org/t/optimizing-the-linux-kernel-with-autofdo-including-thinlto-and-propeller) > > and LPC talk (https://lpc.events/event/18/contributions/1921/), at Meta, > > we've also successfully optimized the kernel and got similar results. > > > > Again, this is a heads-up before the patch, and I would like to hear > > what people think about having a binary optimizer as a user-selectable > > alternative to Propeller. > > I'd imagine that folks would be interested in running Propeller, or > BOLT, but perhaps not both. > > In that sense, Kconfig has the means to express mutual exclusion. > It's perhaps worth working together to get the kconfig selection > working such that folks can play with enabling these newer toolchain > related technologies. Right, I would expect this to just be a Kconfig choice with a description like "Post link optimization" or something of the sort, like the RANDSTRUCT or DEBUG_INFO ones. If it does make sense to do them at the same time, they can obviously be separate. > The next instance of the bi-weekly public Clang Built Linux meeting is > next Wednesday. (Links from https://clangbuiltlinux.github.io/) > > Perhaps it's worth Rong (and Sriraman and Han) and Maksim to stop by and chat? I would certainly be open to discussing the plans for upstreaming these in the meeting. I think the sessions went well in the Toolchains Track. There were no major objections from what I could tell. Cheers, Nathan