[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAEf4BzYa1o5FYWGY3tt6O_7LK5h+NmiFzM9QhnKA5n3w-3=p7Q@mail.gmail.com>
Date: Fri, 11 Mar 2022 11:11:13 -0800
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Hao Luo <haoluo@...gle.com>
Cc: Pasha Tatashin <pasha.tatashin@...een.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
Song Liu <songliubraving@...com>,
Namhyung Kim <namhyung@...nel.org>,
Blake Jones <blakejones@...gle.com>, bpf <bpf@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>,
Greg Thelen <gthelen@...gle.com>
Subject: Re: [PATCH bpf-next v2] bpf: Cache the last valid build_id.
On Thu, Mar 10, 2022 at 5:16 PM Hao Luo <haoluo@...gle.com> wrote:
>
> On Fri, Feb 25, 2022 at 12:43 PM Pasha Tatashin
> <pasha.tatashin@...een.com> wrote:
> >
> > On 2/23/22 19:05, Hao Luo wrote:
> > > For binaries that are statically linked, consecutive stack frames are
> > > likely to be in the same VMA and therefore have the same build id.
> > > As an optimization for this case, we can cache the previous frame's
> > > VMA, if the new frame has the same VMA as the previous one, reuse the
> > > previous one's build id. We are holding the MM locks as reader across
> > > the entire loop, so we don't need to worry about VMA going away.
> > >
> > > Tested through "stacktrace_build_id" and "stacktrace_build_id_nmi" in
> > > test_progs.
> > >
> > > Suggested-by: Greg Thelen <gthelen@...gle.com>
> > > Signed-off-by: Hao Luo <haoluo@...gle.com>
> >
> > Reviewed-by: Pasha Tatashin <pasha.tatashin@...een.com>
> >
>
> An update with performance numbers. Thanks to Blake Jones for
> collecting the stats:
>
> In a production workload, with BPF probes sampling stack trace, we see
> the following changes:
>
> - stack_map_get_build_id_offset() is taking 70% of the time of
> __bpf_get_stackid(); it was 80% before.
Great, thanks for following up with updated numbers!
>
> - find_get_page() and find_vma() together are taking 75% of the time
> of stack_map_get_build_id_offset(); it was 83% before.
>
> Note the call chain is
>
> __bpf_get_stackid()
> -> stack_map_get_build_id_offset()
> -> find_get_page()
> -> find_vma()
>
> > Thanks,
> > Pasha
Powered by blists - more mailing lists