[PATCH bpf-next] bpf: make update_prog_stats always_inline

From: Menglong Dong
Date: Wed Jun 18 2025 - 04:58:41 EST


The function update_prog_stats() will be called in the bpf trampoline.
Make it always_inline to reduce the overhead.

Signed-off-by: Menglong Dong <dongml2@xxxxxxxxxxxxxxx>
---
kernel/bpf/trampoline.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/bpf/trampoline.c b/kernel/bpf/trampoline.c
index c4b1a98ff726..134bcfd00b15 100644
--- a/kernel/bpf/trampoline.c
+++ b/kernel/bpf/trampoline.c
@@ -911,8 +911,8 @@ static u64 notrace __bpf_prog_enter_recur(struct bpf_prog *prog, struct bpf_tram
return bpf_prog_start_time();
}

-static void notrace update_prog_stats(struct bpf_prog *prog,
- u64 start)
+static __always_inline void notrace update_prog_stats(struct bpf_prog *prog,
+ u64 start)
{
struct bpf_prog_stats *stats;

--
2.39.5