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

From
Jiri Olsa <hidden>
Date
2026-11-12 18:33:10
Also in
bpf, lkml
Reply to
Peter Zijlstra, 2026-11-12
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:
quoted
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 :-)
quoted
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.
quoted
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

quoted

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
Thread (34 messages) 34 messages, 6 authors, last reply 4d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help