A Linux 7.0 kernel has adopted a set of changes based on which performance improvements were achieved in stress testing within a 100-gigabit network, increasing the processing of incoming UDP packets by 12%. The optimization was implemented through manual inlining of 2 functions. It is noted that the timecounter_cyc2time() function can be called for each incoming packet since modern protocols require consideration of the packet's arrival time. As a result, under load, szerveren the timecounter_cyc2time() function can be called more than 100 million times per second.
In this situation, the automatic optimizations applied by the compiler, such as FDO (Feedback Directed Optimization), LTO (Link Time Optimization), and PGO (Profile Guided Optimization), failed to detect the hot code segment and ignored it, apparently due to the fact that network card drivers are supplied as separate modules. However, manual inline expansion of the function resulted in significant performance gains.
Forrás: opennet.ru
