I haven't found the answer by googling. I'm wondering because I can't make sense of what I see on my M1 MacBook Air when giving it a heavy load of BOINC jobs when on battery vs. plugged in. Screenshots show macOS assigning the four jobs to the same four cores, regardless of power source; I naively expected a difference. No matter what I try, BOINC runs only on the right four cores, never the left four, even when I give it eight jobs. But what are the MenuMeters left and right, performance or efficiency? Is BOINC doing the choosing?
-
I'm not convinced that the core-allocation is done at the OS level.– benwiggyCommented Sep 6, 2021 at 15:44
-
Where in the screenshots do you see core assignment? What does Activity Monitor show in both cases?– nohillside ♦Commented Sep 6, 2021 at 16:47
-
Core assignments are the eight vertical bars in the MenuMeters display.– vonlostCommented Sep 6, 2021 at 18:15
-
Activity Monitor doesn’t mention cores, shows only the running processes.– vonlostCommented Sep 6, 2021 at 18:21
-
@benwiggy Core-allocation is certainly done by the operating system.– jksoegaardCommented Sep 6, 2021 at 18:33
2 Answers
In general the developer of the software can choose (or at least strongly indicate to the operating system) which type of core to use. The developer sets a quality-of-service expectation and the operating system generally follows that.
In addition to the developer supplied QoS expectation, the operating system monitors the application's workload over a period of time, as well as the whole system's workload over a period of time, and use heuristics to make an overall decision on whether to schedule a specific thread on a P-core (performance) or E-core (energy).
Note that applications and background processes are treated differently in this respect. For example a GUI application could be treated differently whether its window(s) are in the foreground or in the background. For background processes (such as BOINC computation) that doesn't apply.
You can read a relatively non-technical overview of how it works here:
https://developer.apple.com/news/?id=vk3m204o
And a bit more specifics (but still overview information) about the QoS-classes here:
Note that it is actually often possible for you as the user to override the QoS-class set by the developer. Get the PID (process ID) of the BOINC job you want to affect (using for example Activity Monitor) - and then use the taskpolicy
command to set a new quality-of-service class.
By the load set by you.
The more programs or more likely an algorithm that looks at the processor loading based on the activities in progress which brings in more or fewer cores as needed to meet a given performance rating.
Most processors will max out when provided with mains power and are throttled when on battery for a longer life.
-
Is that generically, or MacOS M1-specific? My M1 has four + four cores. MenuMeters shows the eight cores as individual vertical bars. I run four processes of BOINC at 100%. Plugged into mains, the rightmost four bars are filled. On battery the rightmost four bars are also filled. I don't know if the rightmost are performance or efficiency cores (anyone know MenuMeters source code?). Perhaps BOINC tells MacOS to always use only one kind of processor.– vonlostCommented Sep 6, 2021 at 5:27
-
@vonlost Why would MenuMeters publicly publish their source code? Commented Sep 6, 2021 at 6:47
-
MenuMeters is open source, but I haven't looked at it. member.ipmu.jp/yuji.tachikawa/MenuMetersElCapitan– vonlostCommented Sep 6, 2021 at 13:54