3 ms·
Nice, but what's the practical benefit? For those who don't know what kallsyms_lookup_name() does.
by deafpolygon 4y ago
Nice, but what's the practical benefit? For those who don't know what kallsyms_lookup_name() does.
- signa11 4y ago`kallsyms_lookup_name()` returns the address associated with any symbol in the kernel's symbol table, f.e. in a module, you can lookup the symbol "getname" (which copies the file name from user space to kernel space) via ``` static typeof(&getname) getname_p; getname_p = (typeof(&getname))kallsyms_lookup_name("getname"); ... ```
- deafpolygon 4y agoAnd this being 700x faster, helps in what way?
- marginalia_nu 4y agoCode calling this function will get slightly faster.
- jasfi 4y agoIt's difficult to estimate the real-world, practical value of this speedup without knowing more. I can't see how this would be noticeable unless it's in an inner loop somewhere, which might be a bad practice.
- marginalia_nu 4y agoAbsolutely. Although these types of optimizations tend to happen when someone has profiled their code and found the function to be a bottleneck, so there might be that one piece of code that speeds up :P
- signa11 4y agoumm, hard to say, probably might shave off couple of milliseconds off of boot times perhaps (think android phones, not servers), faster module loading etc.
- hulitu 4y agoIt will load your kernel modules a bit faster. And taking into accout that this happens usually at boot, the improvement will likely be 0x except on very slow systems.