BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jim Cromie" <jim.cromie@gmail.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH v3 3/4] kallsyms: Add dynamic lookup index for batch resolution
Date: Tue, 22 Sep 2026 18:57:51 +0000	[thread overview]
Message-ID: <20260922185751.922691F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260922-ksyms-tune-v3-3-681a34ea05d9@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] kallsyms: missing __rcu annotation on dyn_kallsyms_offsets
--

commit 6904f1dc3af3434d5089338b55024b752738c7d3
Author: Jim Cromie <jim.cromie@gmail.com>

kallsyms: Add dynamic lookup index for batch resolution

This patch introduces a dynamic u32 lookup index in transient RAM to
accelerate batch symbol resolution during high-volume workloads. It adds
start and end routines to manage the lifetime of the lookup index and
updates the symbol offset lookup to utilize it when available.

> diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
> index d18d78e626db2..06c79ad70cfdc 100644
> --- a/kernel/kallsyms.c
> +++ b/kernel/kallsyms.c
[ ... ]
> +/*
> + * Dynamic symbol offset table.
> + * Allocated on demand during high-volume lookup batches and reclaimed after.
> + */
> +static u32 *dyn_kallsyms_offsets __read_mostly;

[Severity: Low]
Does this declaration need an __rcu annotation?

The pointer is later updated and read using RCU primitives like
rcu_assign_pointer() and rcu_dereference(). Adding __rcu would enable
sparse type checking and prevent static analysis warnings.

[ ... ]
> +void kallsyms_lookup_batch_end(void)
> +{
> +	u32 *offsets = NULL;
> +
> +	mutex_lock(&dyn_kallsyms_mutex);
> +	if (WARN_ON(!dyn_kallsyms_refcnt))
> +		goto out;
> +
> +	if (--dyn_kallsyms_refcnt == 0) {
> +		offsets = dyn_kallsyms_offsets;

[Severity: Low]
Once the __rcu annotation is added to the declaration, will this bare read
trigger sparse warnings?

Since this read is performed under the dyn_kallsyms_mutex, should it use
rcu_dereference_protected() or rcu_access_pointer() instead to satisfy type
safety and static analysis checks?

> +		rcu_assign_pointer(dyn_kallsyms_offsets, NULL);
> +	}
> +out:
> +	mutex_unlock(&dyn_kallsyms_mutex);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260922-ksyms-tune-v3-0-681a34ea05d9@gmail.com?part=3

  reply	other threads:[~2026-09-22 18:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22 18:45 [PATCH v3 0/4] kallsyms: Accelerate symbol name lookups by ~19x Jim Cromie
2026-09-22 18:45 ` [PATCH v3 1/4] kallsyms: Add test_kallsyms_perf module to benchmark lookup latency Jim Cromie
2026-09-22 18:57   ` sashiko-bot
2026-09-22 18:45 ` [PATCH v3 2/4] kallsyms: Match compressed tokens on the fly during binary search Jim Cromie
2026-09-22 18:45 ` [PATCH v3 3/4] kallsyms: Add dynamic lookup index for batch resolution Jim Cromie
2026-09-22 18:57   ` sashiko-bot [this message]
2026-09-22 18:45 ` [PATCH v3 4/4] kallsyms: Unroll 24-bit sequence reconstruction in get_symbol_seq() Jim Cromie

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=20260922185751.922691F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=jim.cromie@gmail.com \
    --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