Linux On The Apple M1 Preparing Better Performance With In-Development CPUFreq Driver
While longtime Linux kernel developer Jens Axboe is most known for his I/O mastery with maintaining the block subsystem and developing features like IO_uring, recently he picked up an Apple MacBook Pro with an M1 Pro and jumped into the M1 Linux community.
After a few days of tinkering, Axboe shared last week that he was "very impressed by the hardware" with the M1 Pro and then began dabbling with the CPUFreq support for the Apple M1, which was started by Asahi Linux developer Hector Martin.
Axboe then tweeted out yesterday about the great performance being seen with the Apple M1 Pro with the latest Linux patches, including the CPUFreq support.
With proper cpufreq support on the m1 pro, doing an apples-to-apples kernel compile comparison between the m1 and x1 gen9 (i7-1185G7) is eye opening.
— Jens Axboe (@axboe) February 15, 2022
x1: 215 seconds
m1: 82 seconds
2.6x faster. This is ridiculous!
With the patched up kernel on the Apple M1, he can build a Linux kernel in 82 seconds with his M1 Pro laptop. Meanwhile his former laptop a Lenovo ThinkPad X1 Gen9 with Core i7 1185G7 "Tiger Lake" takes 215 seconds to build the very same kernel configuration.
It's a big speed-up he is seeing with the Apple M1 Pro over Axboe's former Tiger Lake laptop. The Apple M1 Max should allow even faster kernel builds. Granted, he is currently relying on out-of-tree kernel patches for the CPUFreq driver and other work that has yet to be mainlined. He did add that the Apple laptop can now work out "good enough" as a daily driver for him while acknowledging there is no working GPU acceleration, no audio support, and no suspend/resume yet. Those other features remain in the works by the Asahi Linux developers and others but at least in the case of good GPU acceleration will still likely take some time to iron out, especially if wanting OpenGL/Vulkan driver support good enough for gaming and other demanding tasks. The current state of other Apple M1 MacBook / Mac Mini features under Linux can be tracked via the Asahi Linux Wiki.
The patches that Jens Axboe has been testing for his Linux kernel builds on the M1 can be found via this Git branch. As part of that is not only the work-in-progress apple-soc CPUFreq driver but also the patches for Apple SMC power/battery stats, simple-mfd-nvmem driver, simple-mfd-spmi, and other patches. Axboe has been working on various fixes and to no surprise he also has some Apple NVMe code improvements.