Re: [PATCH v2 bpf-next] bpf: move sleepable flag from bpf_prog_aux to bpf_prog

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 11, 2024 at 1:20 AM Jiri Olsa <olsajiri@xxxxxxxxx> wrote:
>
> On Fri, Mar 08, 2024 at 04:47:39PM -0800, Andrii Nakryiko wrote:
> > prog->aux->sleepable is checked very frequently as part of (some) BPF
> > program run hot paths. So this extra aux indirection seems wasteful and
> > on busy systems might cause unnecessary memory cache misses.
> >
> > Let's move sleepable flag into prog itself to eliminate unnecessary
> > pointer dereference.
> >
> > Signed-off-by: Andrii Nakryiko <andrii@xxxxxxxxxx>
>
> curious did it show in some profile? however lgtm

Not really, micro-benchmarks won't show this. It's only on busy
systems where CPU cache is heavily utilized that this could make a
difference. I stumbled upon this just by reading code and realizing
this is now not just a verifier thing anymore.

>
> Acked-by: Jiri Olsa <jolsa@xxxxxxxxxx>
>
> jirka
>
>
> > ---
> >  include/linux/bpf.h            |  8 ++++----
> >  kernel/bpf/bpf_iter.c          |  4 ++--
> >  kernel/bpf/core.c              |  2 +-
> >  kernel/bpf/syscall.c           |  6 +++---
> >  kernel/bpf/trampoline.c        |  4 ++--
> >  kernel/bpf/verifier.c          | 12 ++++++------
> >  kernel/events/core.c           |  2 +-
> >  kernel/trace/bpf_trace.c       |  2 +-
> >  net/bpf/bpf_dummy_struct_ops.c |  2 +-
> >  9 files changed, 21 insertions(+), 21 deletions(-)
> >

[...]





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux