From: sashiko-bot@kernel.org
To: "Jiri Olsa" <jolsa@kernel.org>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next 3/9] bpf: Factor stackid_new_bucket from __bpf_get_stackid
Date: Mon, 20 Jul 2026 09:01:40 +0000 [thread overview]
Message-ID: <20260720090141.54DC81F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260720085351.655075-4-jolsa@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The newly introduced `stackid_new_bucket` function accepts `trace` and `flags` parameters which are completely unused within its body.
--
--- Patch [3]: [PATCH bpf-next 3/9] bpf: Factor stackid_new_bucket from __bpf_get_stackid ---
commit cee0ea77a9c1144b54fb0472b1788623044b5650
Author: Jiri Olsa <jolsa@kernel.org>
bpf: Factor stackid_new_bucket from __bpf_get_stackid
This commit factors out the bucket allocation and initialization logic
from __bpf_get_stackid into a new stackid_new_bucket helper function.
> diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c
> index 7bc2a966e3e81..48a2e28f0c68a 100644
> --- a/kernel/bpf/stackmap.c
> +++ b/kernel/bpf/stackmap.c
> @@ -559,31 +559,53 @@ static int stackid_fastpath(struct stackid *stackid, struct bpf_map *map,
> return -ENOENT;
> }
>
> +static struct stack_map_bucket *
> +stackid_new_bucket(struct stackid *stackid, struct bpf_map *map,
> + struct perf_callchain_entry *trace, u64 flags)
[Severity: Low]
Are the trace and flags parameters needed here?
Looking at the implementation of stackid_new_bucket() below, neither trace
nor flags are used anywhere in the function body. Could they be removed
from the function signature to clean up the API?
> +{
> + struct bpf_stack_map *smap = container_of(map, struct bpf_stack_map, map);
> + struct bpf_stack_build_id *id_offs;
> + struct stack_map_bucket *bucket;
> + u32 i;
> +
> + bucket = (struct stack_map_bucket *) pcpu_freelist_pop(&smap->freelist);
> + if (unlikely(!bucket))
> + return NULL;
> +
> + if (stack_map_use_build_id(map)) {
> + id_offs = (struct bpf_stack_build_id *)bucket->data;
> + for (i = 0; i < stackid->nr; i++)
> + id_offs[i].ip = stackid->ips[i];
> + } else {
> + memcpy(bucket->data, stackid->ips, stackid->len);
> + }
> +
> + bucket->hash = stackid->hash;
> + bucket->nr = stackid->nr;
> + return bucket;
> +}
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260720085351.655075-1-jolsa@kernel.org?part=3
next prev parent reply other threads:[~2026-07-20 9:01 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 8:53 [PATCH bpf-next 0/9] bpf: Disable preemption in stack map code Jiri Olsa
2026-07-20 8:53 ` [PATCH bpf-next 1/9] bpf: Factor stackid_init function from __bpf_get_stackid Jiri Olsa
2026-07-20 8:53 ` [PATCH bpf-next 2/9] bpf: Factor stackid_fastpath " Jiri Olsa
2026-07-20 9:09 ` sashiko-bot
2026-07-20 20:31 ` Jiri Olsa
2026-07-20 8:53 ` [PATCH bpf-next 3/9] bpf: Factor stackid_new_bucket " Jiri Olsa
2026-07-20 9:01 ` sashiko-bot [this message]
2026-07-20 20:31 ` Jiri Olsa
2026-07-20 8:53 ` [PATCH bpf-next 4/9] bpf: Use stack id functions instead of __bpf_get_stackid Jiri Olsa
2026-07-20 8:53 ` [PATCH bpf-next 5/9] bpf: Disable preemption in bpf_get_stackid Jiri Olsa
2026-07-20 9:04 ` sashiko-bot
2026-07-20 20:31 ` Jiri Olsa
2026-07-20 8:53 ` [PATCH bpf-next 6/9] bpf: Factor callchain_store function from __bpf_get_stack Jiri Olsa
2026-07-20 9:07 ` sashiko-bot
2026-07-20 20:31 ` Jiri Olsa
2026-07-20 8:53 ` [PATCH bpf-next 7/9] bpf: Factor callchain_finalize " Jiri Olsa
2026-07-20 9:08 ` sashiko-bot
2026-07-20 20:31 ` Jiri Olsa
2026-07-20 8:53 ` [PATCH bpf-next 8/9] bpf: Remove trace_in argument " Jiri Olsa
2026-07-20 9:09 ` sashiko-bot
2026-07-20 20:31 ` Jiri Olsa
2026-07-20 8:53 ` [PATCH bpf-next 9/9] bpf: Disable preemption in __bpf_get_stack Jiri Olsa
2026-07-20 9:18 ` sashiko-bot
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=20260720090141.54DC81F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=jolsa@kernel.org \
--cc=sashiko-reviews@lists.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