Re: [PATCH 01/13] static_call: Index code text reservation lookups

From: Jiri Olsa

Date: Thu Nov 12 2026 - 13:48:32 EST


On Thu, Nov 12, 2026 at 11:11:08AM +0100, Peter Zijlstra wrote:
> On Thu, Nov 12, 2026 at 10:07:34AM +0100, Peter Zijlstra wrote:
> > Looking at this in a little more detail; I'm confused.
> >
> > You're literally adding an index, so that you can find the
> > static_call_size, while all you really need is static_call_addr().
>
> /size/site/ obviously :-)
>
> > That is, you could have just created an array of relocated site->addr
> > and sorted that, that would safe you a ton of indirection all around.
> >
> > That is:
> >
> > index->entries[i] = (long)static_call_addr(start + i) - (long)&index->entries[i];
>
> Should be:
>
> index->entries[i] = (long)static_call_addr(start + i) - (long)index->entries;
>
> They have to all be relative to one location in order for sorting to
> make sense.
>
> > That will make your lookup take at least half the amount of loads.

hum, but we still need the site’s init flag for static_call_is_init

I could store site pointer directly instead of the index and see how
much faster it is


> >
> >
> > Also, you really should support modules, there is no point being fast
> > until you load a module.

I had that, but decided to remove it because my follow up changes
did not support modules as well.. I will include it

jirka