On Fri, Jan 5, 2024 at 2:47 AM Hou Tao <houtao@xxxxxxxxxxxxxxx> wrote: > > From: Hou Tao <houtao1@xxxxxxxxxx> > > Hi, > > The motivation of inlining bpf_kptr_xchg() comes from the performance > profiling of bpf memory allocator benchmark [1]. The benchmark uses > bpf_kptr_xchg() to stash the allocated objects and to pop the stashed > objects for free. After inling bpf_kptr_xchg(), the performance for > object free on 8-CPUs VM increases about 2%~10%. However the performance > gain comes with costs: both the kasan and kcsan checks on the pointer > will be unavailable. Initially the inline is implemented in do_jit() for > x86-64 directly, but I think it will more portable to implement the > inline in verifier. How much work would it take to enable this on other major architectures? AFAICT, most jit compilers already handle BPF_XCHG, so it should be relatively simple? Other than this, for the set Acked-by: Song Liu <song@xxxxxxxxxx> Thanks, Song