6 ms·
Apple XNU: Clutch Scheduler
- trueno 9mo agointeresting. id love an eclecticlight breakdown of this. they're one of the few if only that write anything worth reading on apple hardware, i once found a QOS/scheduler insight through those guys when I couldn't get my c/cpp project pinned to the cores I wanted on m-series. https://eclecticlight.co/m1-macs/ https://eclecticlight.co/m1-macs/
- saagarjha 9mo agoHe doesn’t read code. Convert it to some log messages and he might explore it.
- KerrAvon 9mo agoPlease take anything this fella writes with several grains of salt.
- denotational 9mo agoPlease could you elaborate?
- trueno 9mo agoI mean that goes without saying on anything I read on the damn internet. With that said, I'm not seeing a comparative informational source anywhere that even takes the time of day. Feel free to bombard me with new resources.
- cadamsdotcom 9mo ago> The XNU kernel runs on a variety of platforms This is fascinating, would love to know where it’s used! (Besides macOS)
- electronsoup 9mo agoPerhaps they mean ISAs
- xphos 9mo agoWell x86 at one point, arm both the 32 and 64 bit versions. I think they had RISCV support in their source tree at one point but not really at a commercial level. It does cover a lot different levels of hardware though
- kjs3 9mo agoIs mc68k or PPC still in there anywhere?
- monocasa 9mo agoI'm sure there's vestiges of them somewhere, but the underlying support (the architecture specific parts of the mach portion of the kernel) is gone for those archs.
- mghackerlady 9mo agoI wouldn't be surprised if they keep a minimal Power base maintained behind closed doors. It's how they managed to jump ship to intel so quickly, they never stopped maintaining NeXTSTEPs x86 port
- monocasa 9mo agoI would honestly be shocked if they were. They've been making quite a few changes to the virtual memory code over the past decade, and keeping those vestigial arch's around is a pretty big maintenance burden. It'd probably be less work to just add the arch as if it were new when it's needed at this point since the kernel itself is pretty portable.
- duskwuff 9mo ago
- almoni 9mo agoDoes this contribute to macOS's suitability for DAW applications or is that more the baked in low-latency audio drivers?
- bigyabai 9mo agoCoreAudio probably deserves most of the credit, there. Similar ASIO-style solutions like JACK, DirectSound and now Pipewire hit the sub-30ms mark without any big scheduler tweaks.
- lukeh 9mo agoIOKit was designed to support CoreAudio from the start, cc gvdl.
- KerrAvon 9mo agoCoreAudio was developed alongside xnu / IOKit for Mac OS X, so it’s kind of all of it. Apple had the opportunity to start fresh with a built-in super low-latency audio subsystem at the turn of the century, and they took it.
- dcrazy 9mo agoAudio actually runs on a dedicated realtime thread. This used to be scheduled differently, but nowadays it might be implemented by the FIXPRI bucket described in this document.
- poige 9mo agoDarwin had bunch of schedulers except this one: dualq, multiq, etc In fact here's the one used in Sonoma: sysctl kern.sched -> edge which seems to be an extension over "clutch": https://github.com/apple-oss-distributions/xnu/blob/main/osfmk/kern/sched.h#L197 https://github.com/apple-oss-distributions/xnu/blob/main/osf... "… Single-cluster, symmetric (SMP) systems can run with just the Clutch policy, but multi-cluster, asymmetric (AMP) systems must further enable the Edge policy extension to Clutch in order to manage scheduling across the multiple CPU clusters. …"
- dcrazy 9mo agoEdge is also described in the linked document.
- MarginalGainz 9mo ago[dead]
- travisgriggs 9mo agoRead through much of this. Definitely started feeling like “a picture might be worth 1,000+ words”.