Mesa Fixes A Large Performance Regression For Systems Using HPET

Written by Michael Larabel in Mesa on 17 July 2023 at 10:45 AM EDT. 27 Comments
MESA
The High Precision Event Timer (HPET) has long been a source of issues for Linux developers and it turns out systems relying on HPET rather than the CPU's TSC have in recent months suffered significant performance degradation with the Mesa OpenGL driver code.

Opened back in April was this Mesa bug report around a "huge performance regression". and was tracked to being due to a Mesa OpenGL threading "glthread" change. The performance could be as much as halved since the regression was introduced.

The problem was ultimately found to be when using Mesa OpenGL threading while making use of the High Precision Event Timer (HPET) rather than the CPU's Timestamp Counter (TSC) for hardware timing.

This merge to fix the regression will now determine global locking once every 64 patches in order to call the get time function less frequently.


By making the calls less frequent, the performance impact is lessened as a simple workaround but hopefully most users are relying on TSC rather than HPET. Reading /sys/devices/system/clocksource/clocksource0/current_clocksource will confirm your system's current clock source.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week