[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACkGtrgWRJw2+KX_=Xww773ovYkjq-Bf4Sygo=Hgn86TM7VjLA@mail.gmail.com>
Date: Tue, 14 Oct 2025 20:38:34 -0700
From: Han Shen <shenhan@...gle.com>
To: xur@...gle.com
Cc: Alexey Gladkov <legion@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>,
Ard Biesheuvel <ardb@...nel.org>, Bill Wendling <morbo@...gle.com>, Ingo Molnar <mingo@...nel.org>,
Josh Poimboeuf <jpoimboe@...nel.org>, Justin Stitt <justinstitt@...gle.com>,
Kees Cook <kees@...nel.org>, Linus Walleij <linus.walleij@...aro.org>,
Masahiro Yamada <masahiroy@...nel.org>, Miguel Ojeda <ojeda@...nel.org>,
Nathan Chancellor <nathan@...nel.org>, Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
Nicolas Schier <nicolas.schier@...ux.dev>, Peter Zijlstra <peterz@...radead.org>,
Tamir Duberstein <tamird@...il.com>, Thomas Gleixner <tglx@...utronix.de>,
Thomas Weißschuh <thomas.weissschuh@...utronix.de>,
Yabin Cui <yabinc@...gle.com>, Sriraman Tallam <tmsriram@...gle.com>, linux-kbuild@...r.kernel.org,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH v2 4/4] kbuild: Add config to assert profile accuracy for
aggressive optimization
I've verified patches 1-4, with the following configuration on X86_64 systems:
1. autofdo without profile (nothinlto)
2. autofdo with profile (nothinlto)
3. propeller only (noautofdo no thinlto) annotated
4. propeller only optimized (noautofdo nothinlto)
All the kernels boot up successfully.
Thanks,
Han
On Tue, Oct 14, 2025 at 12:12 PM <xur@...gle.com> wrote:
>
> From: Rong Xu <xur@...gle.com>
>
> Adds a build config to AutoFDO to assert that the generated profile
> accurately represents the intended workload. This enables Clang to
> perform more aggressive optimizations.
>
> Signed-off-by: Rong Xu <xur@...gle.com>
> ---
> arch/Kconfig | 11 +++++++++++
> scripts/Makefile.autofdo | 3 +++
> 2 files changed, 14 insertions(+)
>
> diff --git a/arch/Kconfig b/arch/Kconfig
> index ebe08b9186adc..6fdc676cb0fe4 100644
> --- a/arch/Kconfig
> +++ b/arch/Kconfig
> @@ -886,6 +886,17 @@ config AUTOFDO_CLANG
>
> If unsure, say N.
>
> +config AUTOFDO_PROFILE_ACCURATE
> + bool "Assert AutoFDO profile is accurate (EXPERIMENTAL)"
> + depends on AUTOFDO_CLANG
> + help
> + This option asserts that the AutoFDO profile (specified
> + in CLANG_AUTOFDO_PROFILE) is collected from a representative
> + workload, allowing the Clang compiler to perform more
> + aggressive optimizations.
> +
> + If unsure, say N.
> +
> config ARCH_SUPPORTS_PROPELLER_CLANG
> bool
>
> diff --git a/scripts/Makefile.autofdo b/scripts/Makefile.autofdo
> index 5bcfcef273745..36abeae2accdc 100644
> --- a/scripts/Makefile.autofdo
> +++ b/scripts/Makefile.autofdo
> @@ -11,6 +11,9 @@ endif
> ifdef CLANG_AUTOFDO_PROFILE
> CFLAGS_AUTOFDO_CLANG += -fprofile-sample-use=$(CLANG_AUTOFDO_PROFILE) -ffunction-sections
> CFLAGS_AUTOFDO_CLANG += -fsplit-machine-functions
> +ifdef CONFIG_AUTOFDO_PROFILE_ACCURATE
> + CFLAGS_AUTOFDO_CLANG += -fprofile-sample-accurate
> +endif
> endif
>
> ifdef CONFIG_LTO_CLANG_THIN
> --
> 2.51.0.788.g6d19910ace-goog
>
--
Han Shen | Software Engineer | shenhan@...gle.com | Sunnyvale California
Powered by blists - more mailing lists