From: Nicolas Schier <nsc@kernel.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: "Miguel Ojeda" <miguel.ojeda.sandonis@gmail.com>,
"Alice Ryhl" <aliceryhl@google.com>, "Rong Xu" <xur@google.com>,
"Han Shen" <shenhan@google.com>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
"Matthew Maurer" <mmaurer@google.com>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
rust-for-linux@vger.kernel.org
Subject: Re: [PATCH v2] kbuild: rust: add AutoFDO support
Date: Tue, 7 Apr 2026 20:23:01 +0200 [thread overview]
Message-ID: <adVLhdo-a6_aU87C@levanger> (raw)
In-Reply-To: <20260407164526.GA2309039@ax162>
On Tue, Apr 07, 2026 at 09:45:26AM -0700, Nathan Chancellor wrote:
> On Fri, Apr 03, 2026 at 07:02:15AM +0200, Miguel Ojeda wrote:
> > On Tue, Mar 31, 2026 at 12:58 PM Alice Ryhl <aliceryhl@google.com> wrote:
> > >
> > > This patch enables AutoFDO build support for Rust code within the Linux
> > > kernel. This allows Rust code to be profiled and optimized based on the
> > > profile.
> > >
> > > The RUSTFLAGS variable was suffixed with *_AUTOFDO_CLANG to match the
> > > naming of the config option, which is called CONFIG_AUTOFDO_CLANG.
> > >
> > > This implementation has been verified in Android, first by inspecting
> > > the object files and confirming that they look correct. After that,
> > > it was verified as below:
> > >
> > > 1. Running the binderAddInts benchmark [1] with Rust Binder built as
> > > rust_binder.ko module, using a Pixel 9 Pro.
> > > 2. Collecting a profile on an Pixel 10 Pro XL using the app-launch
> > > benchmark, which starts different apps many times, on a device with
> > > Rust Binder as a built-in kernel module. (C Binder was not present on
> > > the device.)
> > > 3. Using the collected profile, run the binderAddInts benchmark again
> > > with Rust Binder built both as a rust_binder.ko module, and as a
> > > built-in kernel module.
> > > 4. In both cases, Rust Binder without AutoFDO was approximately 13%
> > > slower than the AutoFDO optimized version. Built-in vs .ko did not
> > > make a measurable performance difference.
> > >
> > > All of the above was verified in conjuction with my helpers inlining
> > > series [2], which confirmed that this worked correctly for helpers too
> > > once [3] was fixed in the helpers inlining series.
> > >
> > > Link: https://android.googlesource.com/platform/system/extras/+/920f089/tests/binder/benchmarks/binderAddInts.cpp [1]
> > > Link: https://lore.kernel.org/r/20260203-inline-helpers-v2-0-beb8547a03c9@google.com [2]
> > > Link: https://lore.kernel.org/r/aasPsbMEsX6iGUl8@google.com [3]
> > > Reviewed-by: Rong Xu <xur@google.com>
> > > Reviewed-by: Gary Guo <gary@garyguo.net>
> > > Tested-by: Alice Ryhl <aliceryhl@google.com>
> > > Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> >
> > If Rong/Han or Kbuild want to pick this up, then:
> >
> > Acked-by: Miguel Ojeda <ojeda@kernel.org>
> >
> > Otherwise, please let me know -- thanks!
>
> Unless Nicolas feels strongly otherwise, I think you can just take this
> via the Rust tree.
>
> Acked-by: Nathan Chancellor <nathan@kernel.org>
>
> Cheers,
> Nathan
No objections from me either.
Acked-by: Nicolas Schier <nsc@kernel.org>
Thanks!
--
Nicolas
next prev parent reply other threads:[~2026-04-07 18:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-31 10:57 [PATCH v2] kbuild: rust: add AutoFDO support Alice Ryhl
2026-04-03 5:02 ` Miguel Ojeda
2026-04-07 16:45 ` Nathan Chancellor
2026-04-07 18:23 ` Nicolas Schier [this message]
[not found] ` <CAF1bQ=TxmN4q1mw8YL_62wnEsNbz4tCy8uHwS2GOX39o=7=hsA@mail.gmail.com>
2026-04-09 17:38 ` Miguel Ojeda
2026-05-27 10:40 ` Miguel Ojeda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=adVLhdo-a6_aU87C@levanger \
--to=nsc@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=gary@garyguo.net \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=mmaurer@google.com \
--cc=nathan@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=shenhan@google.com \
--cc=tmgross@umich.edu \
--cc=xur@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.