Commit 9b06b3fc authored by Gary Guo's avatar Gary Guo Committed by Treehugger Robot
Browse files

UPSTREAM: rust: alloc: make `ReallocFunc::call` inline



This function can be called with different function pointers when
different allocator (e.g. Kmalloc, Vmalloc, KVmalloc), however since
this function is not polymorphic, only one instance is generated,
and function pointers are used. Given that this function is called
for any Rust-side allocation/deallocation, performance matters a lot,
so making this function inlineable.

This is discovered when doing helper inlining work, since it's discovered
that even with helpers inlined, rust_helper_ symbols are still present
in final vmlinux binary, and it turns out this function is inhibiting
the inlining, and introducing indirect function calls.

Signed-off-by: default avatarGary Guo <gary@garyguo.net>
Acked-by: default avatarDanilo Krummrich <dakr@kernel.org>
Reviewed-by: default avatarBoqun Feng <boqun.feng@gmail.com>
Reviewed-by: default avatarAlice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20250105194054.545201-4-gary@garyguo.net


Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>

Bug: 454054050
(cherry picked from commit 41b6a812)
Change-Id: I3e4967e51686600975ed831a8e1ed3f0da3cb08d
Signed-off-by: default avatarAlice Ryhl <aliceryhl@google.com>
parent 5c723db5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment