All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Stanislaw Gruszka" <stf_xl@wp.pl>,
	linux-modules@vger.kernel.org,
	"Sami Tolvanen" <samitolvanen@google.com>,
	"Luis Chamberlain" <mcgrof@kernel.org>,
	"Petr Pavlu" <petr.pavlu@suse.com>
Cc: linux-trace-kernel@vger.kernel.org,
	live-patching@vger.kernel.org,
	"Daniel Gomez" <da.gomez@kernel.org>,
	"Aaron Tomlin" <atomlin@atomlin.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	"Jordan Rome" <linux@jordanrome.com>,
	"Viktor Malik" <vmalik@redhat.com>,
	"Petr Mladek" <pmladek@suse.com>
Subject: Re: [PATCH v3 2/3] module/kallsyms: sort text symbol indices and use binary search
Date: Wed, 18 Nov 2026 15:02:42 +0000	[thread overview]
Message-ID: <sashiko-outbox-221282@kernel.org> (raw)
In-Reply-To: <20261118145125.29399-3-stf_xl@wp.pl>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] module/kallsyms: leftover commented-out debug function pr_tab()
--

commit 70739117310db5d1cdad00c748372a0032a51a0f
Author: Stanislaw Gruszka <stf_xl@wp.pl>

module/kallsyms: sort text symbol indices and use binary search

This commit builds a sorted index array of core text symbols during module
load and uses binary search to speed up module text address lookups in
find_kallsyms_symbol().

Link: https://gist.github.com/sgruszka/09f3fb1dad53a97b1aad96e1927ab117 [1]
Link: https://lwn.net/Articles/1105642/ [2]

> diff --git a/kernel/module/kallsyms.c b/kernel/module/kallsyms.c
> index 5dae0832714a9..4e7a1c5a3b8bd 100644
> --- a/kernel/module/kallsyms.c
> +++ b/kernel/module/kallsyms.c

[ ... ]

> @@ -161,12 +259,28 @@ void layout_symtab(struct module *mod, struct load_info *info)
>  	mod_mem_init_data->size = ALIGN(mod_mem_init_data->size,
>  					__alignof__(struct mod_kallsyms));
>  	info->mod_kallsyms_init_off = mod_mem_init_data->size;
> +	info->num_text_syms = ntxt;
>  
>  	mod_mem_init_data->size += sizeof(struct mod_kallsyms);
>  	info->init_typeoffs = mod_mem_init_data->size;
>  	mod_mem_init_data->size += nsrc * sizeof(char);
>  }
>  
> +// static void pr_tab(unsigned int *tab, unsigned int n, Elf_Sym *syms)
> +// {
> +// 	int i;
> +// 	// printk("\n");
> +// 	for (i = 0; i < n; i++) {
> +// 		printk(KERN_CONT "%d,", tab[i]);
> +// 	}
> +// 	printk("VALUES \n");
> +// 	for (i = 0; i < n; i++) {
> +// 		printk(KERN_CONT "0x%08llx,",
> +// 		       (unsigned long long)syms[tab[i]].st_value);
> +// 	}
> +// 	printk("\n");
> +// }
> +//

[Severity: Low]
Was this commented-out pr_tab() debug helper left in by mistake?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261118145125.29399-1-stf_xl@wp.pl?part=2

  reply	other threads:[~2026-11-18 15:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 14:51 [PATCH v3 0/3] module/kallsyms: sort function symbols and use binary search Stanislaw Gruszka
2026-11-18 14:51 ` [PATCH v3 1/3] module/kallsyms: include empty names in is_ignored_kernel_symbol() Stanislaw Gruszka
2026-11-18 14:51 ` [PATCH v3 2/3] module/kallsyms: sort text symbol indices and use binary search Stanislaw Gruszka
2026-11-18 15:02   ` sashiko-bot [this message]
2026-11-19 13:28     ` Stanislaw Gruszka
2026-11-18 14:51 ` [PATCH v3 3/3] module/kallsyms: enable indexed text lookup for livepatch modules Stanislaw Gruszka

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=sashiko-outbox-221282@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=atomlin@atomlin.com \
    --cc=da.gomez@kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=linux@jordanrome.com \
    --cc=live-patching@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=petr.pavlu@suse.com \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=samitolvanen@google.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=stf_xl@wp.pl \
    --cc=vmalik@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.