| ▲ | drob518 10 hours ago |
| Does anyone have any insight into the MacOS scheduler and the algorithm it uses to place threads on E vs. P cores? Is it as simple as noting whether a thread was last suspended blocking on I/O or for a time slice timeout and mapping I/O blockers to E cores and time slice blockers to P cores? Or does the programmer indicate a static mapping at thread creation? I write code on a Mac all the time, but I use Clojure and all the low level OS decisions are opaque to me. |
|
| ▲ | macshome 10 hours ago | parent | next [-] |
| Check out the scheduler documentation that Apple has in the xnu repo. https://github.com/apple-oss-distributions/xnu/blob/main/doc... |
| |
| ▲ | drob518 8 hours ago | parent [-] | | This is exactly what I was looking for. Thanks. Lots of technical details here for those interested. |
|
|
| ▲ | detourdog 10 hours ago | parent | prev | next [-] |
| https://developer.apple.com/videos/play/tech-talks/110147/ |
| |
|
| ▲ | masklinn 10 hours ago | parent | prev | next [-] |
| The baseline is static: low QoS tasks are dispatched to the E cores, while high QoS tasks are dispatched to P cores. IIRC high QoS cores can migrate to the E cores if all P cores are loaded, but my understanding is that the lowest QoS tasks (background) never get promoted to P cores. |
| |
| ▲ | drob518 10 hours ago | parent [-] | | How is the QoS communicated to the scheduler? Is there a mark on the binary or does the code do it at thread startup? | | |
| ▲ | dcrazy 10 hours ago | parent | next [-] | | The Apple software stack makes heavy use of thread pools via libdispatch. Individual work items are tagged with QoS, which influences which thread picks up the work item from the queue. | |
| ▲ | saagarjha 10 hours ago | parent | prev [-] | | It’s done in code. |
|
|
|
| ▲ | 8 hours ago | parent | prev | next [-] |
| [deleted] |
|
| ▲ | sys_64738 10 hours ago | parent | prev [-] |
| The article mentions P or E is generally decided by if it's a "background" process (whatever than means). Possible some (undocumented) designation in code or directive to the compiler of the binary decides this at compile time. |
| |