Asahi Linux gives hope for weird page sizes yet


Asahi Linux, a new distribution for Apple silicon-based machines (which sounds like some Star Trek silicon-based lifeform), has made an official alpha release. Although we've got a couple M1 systems here at Floodgap Orbiting Headquarters, that's not really the reason we care about it here. The reason is that Asahi Linux is currently a 16K-page system.

Recall from our previous article that many Power ISA distros, most notably Fedora, default to a 64K memory page for performance reasons rather than the more typical 4K page seen in most operating systems and on most x86_64 machines. (Void and others, on the other hand, are 4K.) This was also true of aarch64, which Fedora and RHEL also used 64K pages for, but Fedora moved to 4K pages on that architecture to cater to small devices like the Raspberry Pi and issues with the Continguous Memory Allocator.

However, Asahi Linux's choice of a 16K page size is even more unusual and not all aarch64 implementations support it, though that's irrelevant on the specific machines they cater to. From the docs, it was chosen because it "both performs better, and is required with our kernel branch right now in order to work properly with the M1’s IOMMUs." Like 64K pages this breaks software that assumes a 4K page size. Most notably for Asahi this breaks Chromium (trying to find sympathy, still trying, still trying, sympathy failed) but also jemalloc and a number of other things.

The fact that a more high-profile architecture also relies on an atypical page size is good news for us, because while there are plenty of projects that couldn't care less about ppc64le, those same projects are much more likely to pay attention to the same problem on an M1 Mac. If the fixes they upstream aren't lazy and support all of the page sizes aarch64 does (4K, 16K and 64K), then this in turn will help 64K-page OpenPOWER systems like the one I'm typing this on. To the extent that happens, we should thank the hackers on Asahi Linux, because they will have made it possible.

Comments

  1. For DEC Alpha processors, the minimum page size was 8K. The maximum is probably 2M and you could adjust it. I remember RedHat was good at it. Gentoo now supports this too ;-)

    I think these problems are a classic example of the bad influence of monoculture on the environment, in this case on the development community ;-)

    ReplyDelete
  2. A lot of heroic work is going into reverse engineering Apple’s GPUs in Apple Silicon, especially by Alyssa Rosenzweig. But in the short to medium term it’s likely that AMD (and maybe Intel) cards in eGPU enclosures will be the only way to get consistent, high-performing 3D in Asahi. If that leads to AMDGPU getting refactored to reliably work on non-4K page sizes, that can only be a good thing. (For what it’s worth Intel appears committed to working on non-x86 kit, so we’ll see where that goes.)

    ReplyDelete

Post a Comment

Comments are subject to moderation. Be nice.