A Linux kernel időzítő frekvenciájának alapértelmezett 1000Hz-ra történő emelésének megvitatása

A Google engineer has suggested raising the default timer interrupt frequency in the Linux kernel to 1000Hz, which would lead to an increase in task switching frequency and a reduction in time quantum in the task scheduler. Currently, the default setting is 250Hz, which serves as a compromise between performance, latency, and energy consumption.

When using displays with a refresh rate of 120Hz, typical for modern PCs and mobile devices, a timer frequency of 250Hz results in a time quantization error of about half the frame time, reducing resource allocation efficiency and preventing optimal performance-to-energy consumption ratios. Energy consumption in systems with a low timer frequency can be higher since the DVFS (Dynamic Voltage and Frequency Scaling) mechanism employs a more aggressive frequency selection strategy to avoid slowing down task execution.

Situations arise where a task has completed the desired operations requiring active computations, but the processor continues to operate at an elevated frequency due to the finite time quantum that has not yet expired. Increasing the task switching frequency may lead to lower energy consumption due to more efficient dynamic frequency scaling (DVFS), more accurate interval distribution by the task scheduler, more frequent updates of CPU load statistics, and shorter wait times for tasks.

Another engineer from Google proposed keeping the timer frequency as is (250Hz), as increasing the timer interrupt frequency may lead to higher energy consumption on low-power devices, such as Internet of Things boards. According to his assessment, setting the frequency to 1000Hz has resulted in a 7% increase in CPU energy consumption in some situations on devices running Android. With a higher timer frequency, the CPU may also wake up more frequently, since at 250Hz, timers set to intervals of t + 1 ms, t + 2 ms, t + 3 ms, and t + 4 ms would be grouped together to result in a single wake-up, while at 1000Hz, there would be four separate wake-ups.

A Phoronix forrás összehasonlította az AMD Ryzen 9 9950X CPU-val rendelkező PC-k teljesítményét. Az 1000Hz-es konfiguráció gyorsabbnak bizonyult a Llama.cpp, nginx, SuperTuxKart, Selenium tesztjeiben és a kernel fordítási idejének mérésénél. A Darktable, PostgreSQL, Unvanquished, Xonotic, Blender, SVT-AV1 és RawTherapee tesztjein a teljesítmény a 250Hz-es beállítással volt magasabb. 1000Hz esetén az átlagos energiafogyasztás 144,2 W volt, a minimum 0,18 W, a maximum pedig 202,13 W, míg 250Hz esetén: átlag 144,37 W, minimum 0,07 W, maximum 202 W.

A Linux kernel időzítő frekvenciájának alapértelmezett 1000Hz-ra történő emelésének megvitatása


Forrás: opennet.ru
Megbízható hosting vásárlása weboldalak számára, DDoS védelemmel, VPS VDS szerverek. 🔥 Megbízható webtárhely vásárlása DDoS védelemmel, VPS VDS szerverek | ProHoster