Re: [PATCH] bpf: Separate bpf_local_storage_lookup() fast and slow paths

2024-02-07 Thread Marco Elver
On Tue, Feb 06, 2024 at 05:22PM -0800, Martin KaFai Lau wrote: > On 2/6/24 9:04 AM, Marco Elver wrote: > > On Mon, Feb 05, 2024 at 03:24PM -0800, Martin KaFai Lau wrote: > > [...] > > > > Or can you suggest different functions to hook to for the recursion > > > > test? > > > > > > I don't prefer

Re: [PATCH] bpf: Separate bpf_local_storage_lookup() fast and slow paths

2024-02-06 Thread Martin KaFai Lau
On 2/6/24 9:04 AM, Marco Elver wrote: On Mon, Feb 05, 2024 at 03:24PM -0800, Martin KaFai Lau wrote: [...] Or can you suggest different functions to hook to for the recursion test? I don't prefer to add another tracepoint for the selftest. Ok - I also checked, even though it should be a

Re: [PATCH] bpf: Separate bpf_local_storage_lookup() fast and slow paths

2024-02-06 Thread Marco Elver
On Mon, Feb 05, 2024 at 03:24PM -0800, Martin KaFai Lau wrote: [...] > > Or can you suggest different functions to hook to for the recursion test? > > I don't prefer to add another tracepoint for the selftest. Ok - I also checked, even though it should be a no-op, it wasn't (compiler generated

Re: [PATCH] bpf: Separate bpf_local_storage_lookup() fast and slow paths

2024-02-05 Thread Martin KaFai Lau
On 2/5/24 7:00 AM, Marco Elver wrote: On Wed, 31 Jan 2024 at 20:52, Martin KaFai Lau wrote: [...] | num_maps: 1000 | local_storage cache sequential get: | | | hits throughput: 0.357 ± 0.005 M ops/s | 0.325 ± 0.005 M ops/s

Re: [PATCH] bpf: Separate bpf_local_storage_lookup() fast and slow paths

2024-02-05 Thread Song Liu
On Wed, Jan 31, 2024 at 6:19 AM Marco Elver wrote: > [...] > > Signed-off-by: Marco Elver > --- > include/linux/bpf_local_storage.h | 17 - > kernel/bpf/bpf_local_storage.c | 14 -- > .../selftests/bpf/progs/cgrp_ls_recursion.c | 2

Re: [PATCH] bpf: Separate bpf_local_storage_lookup() fast and slow paths

2024-02-05 Thread Marco Elver
On Wed, 31 Jan 2024 at 20:52, Martin KaFai Lau wrote: [...] > > | num_maps: 1000 > > | local_storage cache sequential get: > > | | > > | hits throughput: 0.357 ± 0.005 M ops/s | 0.325 ± 0.005 M > > ops/s(-9.0%) > > | hits

Re: [PATCH] bpf: Separate bpf_local_storage_lookup() fast and slow paths

2024-01-31 Thread Marco Elver
On Wed, 31 Jan 2024 at 20:52, Martin KaFai Lau wrote: > > On 1/31/24 6:18 AM, Marco Elver wrote: > > To allow the compiler to inline the bpf_local_storage_lookup() fast- > > path, factor it out by making bpf_local_storage_lookup() a static inline > > function and move the slow-path to

Re: [PATCH] bpf: Separate bpf_local_storage_lookup() fast and slow paths

2024-01-31 Thread Yonghong Song
On 1/31/24 6:18 AM, Marco Elver wrote: To allow the compiler to inline the bpf_local_storage_lookup() fast- path, factor it out by making bpf_local_storage_lookup() a static inline function and move the slow-path to bpf_local_storage_lookup_slowpath(). Base on results from

Re: [PATCH] bpf: Separate bpf_local_storage_lookup() fast and slow paths

2024-01-31 Thread Martin KaFai Lau
On 1/31/24 6:18 AM, Marco Elver wrote: To allow the compiler to inline the bpf_local_storage_lookup() fast- path, factor it out by making bpf_local_storage_lookup() a static inline function and move the slow-path to bpf_local_storage_lookup_slowpath(). Base on results from

[PATCH] bpf: Separate bpf_local_storage_lookup() fast and slow paths

2024-01-31 Thread Marco Elver
To allow the compiler to inline the bpf_local_storage_lookup() fast- path, factor it out by making bpf_local_storage_lookup() a static inline function and move the slow-path to bpf_local_storage_lookup_slowpath(). Base on results from './benchs/run_bench_local_storage.sh' this produces