1. 19

  2. 2

    This a stack of information for someone deep in the understanding of the cores. There are some significant limitations to the article: no conclusions, lots of pretty and unlabelled graphs, and no narrative thread. For those that are working specifically in thread optimizations for the M1, this might be background information.

    1. 1

      threads need to be allocated by core type, a task which can be left to apps and processes, as it is in Asahi Linux, or managed by the operating system, as it is in macOS.

      This is pretty interesting, I thought this task would always be assigned to the underlying OS

      1. 7

        I thought this task would always be assigned to the underlying OS

        It is. The difference is in how you communicate policy to the OS. There are roughly three ways of doing this, with small variations between them:

        • Provide nothing. The OS may make decisions based on profiling counters and so on.
        • Provide some high-level policy such as priority or workload type (e.g. background, realtime, interactive).
        • Provide explicit core-affinity information, such as ‘pin this thread to this core / set of cores’.

        I believe macOS uses mostly the second approach, Linux mostly the third. The second has the advantage that your program doesn’t need to know about topology at all and is much easier for programmers to get some good benefit from. The third is much harder to use but allows a program to be tuned aggressively for a particular machine. This is quite a good summary of the difference between the XNU and Linux philosophies in general.

        1. 1

          Thanks for the in-depth explanation, David!