From: Matt Mackall <mpm@selenic.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Andi Kleen <ak@muc.de>, Andrew Morton <akpm@osdl.org>,
randy.dunlap@osdl.org, Sam Ravnborg <sam@ravnborg.org>,
lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>,
Keith Owens <kaos@sgi.com>
Subject: Re: [PATCH] Sort kallsyms in name order: kernel shrinks by 30k
Date: Tue, 11 May 2004 20:47:30 -0500 [thread overview]
Message-ID: <20040512014730.GP5414@waste.org> (raw)
In-Reply-To: <1084317416.17692.29.camel@bach>
On Wed, May 12, 2004 at 09:16:56AM +1000, Rusty Russell wrote:
> On Tue, 2004-05-11 at 18:08, Andi Kleen wrote:
> > On Tue, May 11, 2004 at 03:08:55PM +1000, Rusty Russell wrote:
> > > Admittedly, anyone who sets CONFIG_KALLSYMS doesn't care about space,
> > > it's a fairly trivial change.
> >
> > As long as nobody does binary search it's good. Wonder why I did not
> > have this idea already with the original stem compression change ;-)
>
> ISTR that someone (I thought you) mentioned doing this before.
>
> In general this code was considered non-speed-critical, but Keith points
> out its use in wchan. A simple cache might make more sense there,
> however.
>
> A binary search as stands doesn't help much because we still need to
> iterate through the names. We could do "address, nameindex" pairs, but
> with stem compression we need to at least wade back some way to decode
> the name.
I'd like to delta compress the addresses as well. I think the way to
do this is to change the address table to be sparsed by a factor of 16
or 32 or so, with pointers into the stem table. The pointers are
chosen to land us on stems of length 0 so we don't have to do any
backtracking. Then in addition to stem length, we keep a 16-bit
address delta.
So we do a binary (or linear) search on the reduced address table, hop
into the stem table, and iterate along as before until we find our
symbol. Even if we stick with linear search on the address table,
we've sped up the search by 32x. So now we have nearly random access
into the stem table and for 15000 symbols, we'll save on the order of
30k (and 90k on 64-bit!).
We can also drop the nulls from the end of the ascii strings and look
for termination by finding the next stem code (hopefully always in the
control character range). This should be worth another 15k.
--
Matt Mackall : http://www.selenic.com : Linux development and consulting
next prev parent reply other threads:[~2004-05-12 1:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-11 5:08 [PATCH] Sort kallsyms in name order: kernel shrinks by 30k Rusty Russell
2004-05-11 5:23 ` Keith Owens
2004-05-11 8:08 ` Andi Kleen
2004-05-11 15:35 ` Randy.Dunlap
2004-05-11 23:16 ` Rusty Russell
2004-05-12 1:47 ` Matt Mackall [this message]
2004-05-12 6:00 ` Andi Kleen
-- strict thread matches above, loose matches on Subject: below --
2004-05-13 0:05 Albert Cahalan
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=20040512014730.GP5414@waste.org \
--to=mpm@selenic.com \
--cc=ak@muc.de \
--cc=akpm@osdl.org \
--cc=kaos@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=randy.dunlap@osdl.org \
--cc=rusty@rustcorp.com.au \
--cc=sam@ravnborg.org \
/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