Re: [PATCH 01/13] static_call: Index code text reservation lookups
From: Peter Zijlstra
Date: Thu Nov 12 2026 - 05:22:52 EST
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.
>
>
> Also, you really should support modules, there is no point being fast
> until you load a module.