[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87y5vgoqx0.fsf@rustcorp.com.au>
Date: Wed, 16 Nov 2011 10:54:27 +1030
From: Rusty Russell <rusty@...tcorp.com.au>
To: Jan Beulich <JBeulich@...e.com>,
Kevin Cernekee <cernekee@...il.com>
Cc: linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V2 2/2] module: Fix performance regression on modules with large symbol tables
On Mon, 14 Nov 2011 08:48:52 +0000, "Jan Beulich" <JBeulich@...e.com> wrote:
> > + name = &mod->strtab[src->st_name];
> > + if (unlikely(!test_bit(src->st_name, info->strmap))) {
> > + /* Symbol name has already been copied; find it. */
> > + char *dup;
> > +
> > + for (dup = mod->core_strtab; strcmp(dup, name); dup++)
> > + BUG_ON(dup > s);
>
> Aren't you concerned that this again will be rather slow? It would be
> pretty easy to accelerate by comparing only with the tail of each string
> (as nothing else can possibly match), moving from string to string instead
> of from character to character.
Kevin's central thesis is that this is actually really unusual.
I'm not sure how much faster a tail search would be in practice. We're
still scanning the string. Perhaps a "dup[0] == name[0] &&" would
optimize it almost as well, if gcc doesn't already?
Kevin, you're probably in an optimal position to get numbers on this?
Thanks,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists