A set of changes has been incorporated into the codebase that forms the kernel of Linux 7.0, which, during stress testing in a 100-gigabit network, allowed for a 12% increase in the performance of incoming UDP packet processing. The optimization was achieved by manually inlining 2 functions. It is noted that the function timecounter_cyc2time() may be called for each incoming packet, as modern protocols require consideration of the packet arrival time. Because of this, under heavy load, server the function timecounter_cyc2time() may be called over 100 million times per second.
In this situation, optimizations automatically applied by the compiler, such as FDO (Feedback Directed Optimization), LTO (Link Time Optimization), and PGO (Profile Guided Optimization), could not detect the hot code path and ignored it, apparently because network card drivers are supplied as separate modules. However, manual inline expansion of the function yielded a significant performance gain.
Source: opennet.ru
