Linus Torvalds heeft de problemen met de taakplanner, die naar voren kwamen tijdens de prestatietests, ontkend.

Game developer Malte Skarupke gepubliceerd performance comparison of locks based on Mutex en Spinlock the use of various task schedulers. Tests showed abnormally large delays when using Spinlock with the default task scheduler used in Linux. The author of the tests concluded that the Linux task scheduler has issues that negatively impact the performance of games designed for the Google Stadia service, where games run on a GPU in a cloud environment, and the client only streams the screen content at up to 60 frames per second. Under such conditions, timely output of frames to the screen is crucial, and delays exceeding a millisecond become noticeable.

For discussion of the tests joined Linus Torvalds, who called them garbage ('pure garbage') and an example of how one can, without fully understanding the subject, obtain results that do not reflect the real situation. Spinlock is a low-level primitive that must be used in user space with great caution and a complete understanding of the details; otherwise, one may get what was demonstrated by the test author. Linus advised game developers not to use spinlock and not to try to build their own locking systems based on it, but to use existing proven mechanisms that inform the system about waiting for the lock release to eliminate the scheduler's influence.

Spinlock-based overlays can only be used when one is completely sure that the scheduler will not interrupt their execution. The locks based on spinlock used in the tests are implemented through a homemade wrapper operating in user space. The task scheduler can take control at any random moment during the execution of this wrapper and switch to executing another task. Since performance measurement is based on absolute timer values, certain delays in the tests cover not only delays in the lock handler but also code that was executed in a different context, i.e., they measure not only what the test author tried to measure, but also the 'noise' from other computations in the system.

Test author probeerde om Linus te weerleggen door aan te geven dat het gebruik van eigen blokkadesystemen op basis van spinlock vaak in de praktijk wordt gebruikt in games, omdat tests met eenvoudigere planningssystemen dan in Linux hogere prestaties laten zien. Linus weigerde, dat de Linux-planner universeel is, decennialang is verfijnd en is geoptimaliseerd niet alleen voor desktops en games, maar ook voor andere soorten belasting, zoals serversystemen, en daarom rekening houdt met veel nuances bij het plannen van taakuitvoeringen.

Het toevoegen van specifieke optimalisaties die de latentie in Google Stadia-games kunnen verlagen, kan de reactiesnelheid in een specifiek geval verbeteren, maar zal waarschijnlijk leiden tot een vermindering van de efficiƫntie van de planner in het algemeen. Bijvoorbeeld, de Windows-planner presteert beter in de besproken tests, omdat hij aanzienlijk eenvoudiger is dan de Linux-planner en voornamelijk is geoptimaliseerd voor desktop-specifieke taken.

Bron: opennet.ru

Koop betrouwbare webhosting met bescherming tegen DDoS, VPS VDS servers šŸ”„ Koop betrouwbare webhosting met bescherming tegen DDoS, VPS VDS servers | ProHoster