Linux on the Apple M1, the CPUFreq driver under development has improved performance

2022-06-06 0 By

As with most modern soCs/processors, proper CPU frequency scaling/performance state management is absolutely critical to getting good performance out of the hardware, both to ensure the CPU reaches its performance state and to reduce power/heat when it is not needed.To avoid heat throttling and extend battery life.Fortunately, a CPUFreq driver for the Apple M1 is being developed for Linux, which allows for a combination of attractive performance and good battery life to support community-driven open source support from Apple Silicon.While longtime Linux kernel developer Jens Axboe is best known for his mastery of I/O, he can maintain block subsystems and develop functions like IO_uring,But recently he picked up an Apple MacBook Pro with M1 Pro and joined the M1 Linux community.After a few days of tinkering, Axboe shared last week that he was “very impressed” with the M1 Pro’s hardware, and then dabbled in CPUFreq support for The Apple M1, which was initiated by Asahi Linux developer Hector Martin.Axboe tweeted yesterday about the excellent performance of the Apple M1 Pro and the latest Linux patch, including CPUFreq support.With the patched kernel on the Apple M1, he was able to build a Linux kernel in 82 seconds on an M1 Pro laptop.Meanwhile, his previous laptop, the Lenovo ThinkPad X1 Gen9 with Core I7 1185G7 “Tiger Lake,” took 215 seconds to build the exact same kernel configuration.He saw a big speed boost on the Apple M1 Pro compared to Axboe’s former Tiger Lake laptop.The Apple M1 Max should allow faster kernel builds.Admittedly, he currently relies on out-of-tree kernel patches for the CPUFreq driver and other work that has yet to become mainstream.He did add that the MAC laptop is now “good enough” as his daily driver, while admitting that there is no effective GPU acceleration, no audio support, and no pause/resume.Asahi Linux developers and others are still working on these other features, but at least with good GPU acceleration it may still take some time to figure them out, especially if you want OpenGL/Vulkan driver support to be good enough for gaming and other demanding tasks.The current status of other Apple M1 MacBook/Mac Mini features under Linux can be tracked via the Asahi Linux Wiki.The patches Jens Axboe has been testing for the Linux kernel he built on M1 can be found through this Git branch.As part of this, not only the Apple-SOC CPUFreq driver being developed, but also patches for Apple SMC Power/battery Statistics, Simple-MFD-NVMEm driver, Simple-MFD-SPMI, and other patches.Axboe has been working on various fixes, and it’s no surprise that he has also made some improvements to the Apple NVMe code.