On 1/16/2025 5:03 AM, Ethan Zhao wrote:
On 1/16/2025 3:27 PM, Xin Li wrote:
On 1/15/2025 10:51 PM, Ethan Zhao wrote:
External interrupts (EVENT_TYPE_EXTINT) and system calls (EVENT_TYPE_OTHER) occur more frequently than other events in a typical system. Prioritizing these events saves CPU cycles and optimizes the efficiency of performance- critical paths.
We deliberately hold off sending performance improvement patches at this point, but first of all please read: https://lore.kernel.org/lkml/87fs766o3t.ffs@tglx/
Do you mean Thomas'point "Premature optimization is the enemy of correctness. don't do it" ? Yep, I agree with it.
Yes.
Compared to the asm code generated by the compiler with fewer than 20 cmp instructions, placing a event handler jump table indexed by event- typethere is a negative optimization. That is not deliberately 'hold off', correctness goes first, definitely right.
hpa suggested to introduce "switch_likely" for this kind of optimization on a switch statement, which is also easier to read. I measured it with a user space focus test, it does improve performance a lot. But obviously there are still a lot of work to do.
Thanks! Xin