From: Ihor Solodrai <ihor.solodrai@linux.dev>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Eduard Zingerman <eddyz87@gmail.com>,
Kumar Kartikeya Dwivedi <memxor@gmail.com>,
Puranjay Mohan <puranjay@kernel.org>,
Shakeel Butt <shakeel.butt@linux.dev>,
Mykyta Yatsenko <mykyta.yatsenko5@gmail.com>,
bpf <bpf@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>,
Kernel Team <kernel-team@meta.com>
Subject: Re: [PATCH bpf v4 3/3] bpf: Cache build IDs in sleepable stackmap path
Date: Thu, 14 May 2026 17:27:38 -0700 [thread overview]
Message-ID: <1bfdbc2c-0913-48ef-ab8d-8021e0944884@linux.dev> (raw)
In-Reply-To: <CAADnVQKA+uTzZECqijzRhjfY7MNxr-ehMzjY0ea0S=QWk+KRYA@mail.gmail.com>
On 5/14/26 5:24 PM, Alexei Starovoitov wrote:
> On Thu, May 14, 2026 at 11:48 AM Ihor Solodrai <ihor.solodrai@linux.dev> wrote:
>>
>> Stack traces often contain adjacent IPs from the same VMA or from
>> different VMAs backed by the same ELF file. Cache the last successfully
>> parsed build ID together with the resolved VMA range and backing file
>> so the sleepable build-ID path can avoid repeated VMA locking and file
>> parsing in common cases.
>>
>> Suggested-by: Mykyta Yatsenko <yatsenko@meta.com>
>> Acked-by: Mykyta Yatsenko <yatsenko@meta.com>
>> Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
>> ---
>> kernel/bpf/stackmap.c | 56 ++++++++++++++++++++++++++++++++++++++++---
>> 1 file changed, 53 insertions(+), 3 deletions(-)
>>
>> diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c
>> index c1e96df360c3..8a18c9645933 100644
>> --- a/kernel/bpf/stackmap.c
>> +++ b/kernel/bpf/stackmap.c
>> @@ -226,13 +226,33 @@ static void stack_map_get_build_id_offset_sleepable(struct bpf_stack_build_id *i
>> .vma = NULL,
>> .mm = mm,
>> };
>> - unsigned long vm_pgoff, vm_start;
>> + struct {
>> + struct file *file;
>> + const unsigned char *build_id;
>> + unsigned long vm_start;
>> + unsigned long vm_end;
>> + unsigned long vm_pgoff;
>> + } cache = {};
>> + unsigned long vm_pgoff, vm_start, vm_end;
>
> cache logic cannot go into bpf. it's not a fix.
> So either drop it or the whole thing into bpf-next.
> Which is probably better.
I'll send a v5 targeting bpf-next shortly. Thanks.
prev parent reply other threads:[~2026-05-15 0:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 18:47 [PATCH bpf v4 0/3] bpf: Implement stack_map_get_build_id_offset_sleepable() Ihor Solodrai
2026-05-14 18:47 ` [PATCH bpf v4 1/3] bpf: Factor out stack_map_build_id_set_ip() in stackmap.c Ihor Solodrai
2026-05-14 18:47 ` [PATCH bpf v4 2/3] bpf: Avoid faultable build ID reads under mm locks Ihor Solodrai
2026-05-14 19:37 ` bot+bpf-ci
2026-05-14 20:37 ` Ihor Solodrai
2026-05-14 20:47 ` Shakeel Butt
2026-05-14 21:31 ` Ihor Solodrai
2026-05-14 22:14 ` Shakeel Butt
2026-05-14 22:49 ` Ihor Solodrai
2026-05-14 23:02 ` Shakeel Butt
2026-05-14 18:47 ` [PATCH bpf v4 3/3] bpf: Cache build IDs in sleepable stackmap path Ihor Solodrai
2026-05-14 19:37 ` bot+bpf-ci
2026-05-15 0:24 ` Alexei Starovoitov
2026-05-15 0:27 ` Ihor Solodrai [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1bfdbc2c-0913-48ef-ab8d-8021e0944884@linux.dev \
--to=ihor.solodrai@linux.dev \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=memxor@gmail.com \
--cc=mykyta.yatsenko5@gmail.com \
--cc=puranjay@kernel.org \
--cc=shakeel.butt@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox