All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Laight <david.laight.linux@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: mm-commits@vger.kernel.org, thunder.leizhen@huawei.com,
	thomas.weissschuh@linutronix.de, rostedt@goodmis.org,
	pmladek@suse.com, olsajiri@gmail.com, nsc@kernel.org,
	nathan@kernel.org, mcgrof@kernel.org, masahiroy@kernel.org,
	ljs@kernel.org, kees@kernel.org, geert@linux-m68k.org,
	denis.benato@linux.dev, chewi@gentoo.org,
	andrey.grodzovsky@crowdstrike.com, abelvesa@kernel.org,
	jim.cromie@gmail.com
Subject: Re: + kallsyms-increase-marker-density-to-16-1-to-accelerate-lookups-fix.patch added to mm-nonmm-unstable branch
Date: Mon, 12 Oct 2026 11:14:24 +0100	[thread overview]
Message-ID: <20261012111424.4b88e041@pumpkin> (raw)
In-Reply-To: <20261011081552.e6f08178e6fc8b865e2715d3@linux-foundation.org>

On Sun, 11 Oct 2026 08:15:52 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:

> On Sun, 11 Oct 2026 15:44:01 +0100 David Laight <david.laight.linux@gmail.com> wrote:
> 
> > On Sat, 10 Oct 2026 17:23:40 -0700
> > Andrew Morton <akpm@linux-foundation.org> wrote:
> >   
> > > The patch titled
> > >      Subject: kallsyms: copy constants from __KERNEL__ to user, drop the inclusion
> > > has been added to the -mm mm-nonmm-unstable branch.  Its filename is
> > >      kallsyms-increase-marker-density-to-16-1-to-accelerate-lookups-fix.patch  
> > 
> > There is a problem with the way this change in implemented.
> > Basically the kernel Makefile (etc) only builds scripts/kallsyms if it doesn't exist.
> > This means that if the header file is changed you can easily end up with a kernel
> > that expects a different marker density from that in the data file.
> > That will lead to all sorts of strange/confusing issues.
> > 
> > It would be better to put the 'shift' value into the .S file.
> > It isn't used anywhere where that will make a performance difference.  
> 
> OK, thanks.  I'll remove the v7 series from the 7.3-rcX queue - let's
> revisit for the next -rc cycle.
> 

The patch that changes the name comparison can go in.
That saves 512 bytes of stack but doesn't make (much) difference to
lookups because other things dominate (probably unless you have some
very long symbols from rust code).

I am working on an additional change.
(I posted a v1, v2 adds some extra changes and is taking a while.)
Performance wise it improves name lookup by a factor of ~18 while
only increasing the 'density' to 64:1 (1 bit per two pixels).

I've make the density a kernel config option (default 6 => 64:1).

One of the reasons it is taking 'ages' is because I discovered that four
of the 'token' values aren't actually used in any symbol names (in the
dataset I'm using) - so they can be reused reducing the main table by
~8k (in 1.7M).

David

  reply	other threads:[~2026-10-12 10:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-11  0:23 + kallsyms-increase-marker-density-to-16-1-to-accelerate-lookups-fix.patch added to mm-nonmm-unstable branch Andrew Morton
2026-10-11 14:44 ` David Laight
2026-10-11 15:15   ` Andrew Morton
2026-10-12 10:14     ` David Laight [this message]
2026-10-12 22:39       ` jim.cromie
2026-10-13  8:51         ` David Laight

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=20261012111424.4b88e041@pumpkin \
    --to=david.laight.linux@gmail.com \
    --cc=abelvesa@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=andrey.grodzovsky@crowdstrike.com \
    --cc=chewi@gentoo.org \
    --cc=denis.benato@linux.dev \
    --cc=geert@linux-m68k.org \
    --cc=jim.cromie@gmail.com \
    --cc=kees@kernel.org \
    --cc=ljs@kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=olsajiri@gmail.com \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=thunder.leizhen@huawei.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.