operating-systemcpucpu-architecturemulticorecpu-cores

If the mutlcore system runs only one core, the one core is always same?


I wonder that in the case one core is enough to run, is the only one specific core used?

If so, the performance of the one core will decrease, compared to the other core. Maybe it is not good for whole system.

For example, CPU has 4 core from 0 to 1. When the system call many core, all the core will be used from 0 to 1. However, in other case enough only one core to running, does the 0th core always used?

Any guys who know something about above things, give me some hint. Thanks.

My friend guesses that it maybe different by OS. If so, I want to know the process on each OS


Solution

  • If so, the performance of the one core will decrease, compared to the other core.

    Huh? CPU cores don't wear out and get slower with age. They might eventually fail (especially if overclocked), but it'll work at full speed until that happens.

    Anyway, you can use Linux htop, Windows task manager or resource monitor, or whatever equivalent on MacOS, to see which core is busy when you're running a single-threaded workload. It's not always the same core.

    Some recent Intel and AMD CPUs do have a preferred core that can turbo higher than the others, detected at the factory when they test the CPU to see how fast it can run without errors, so they know whether they can sell it as a 4.0 GHz CPU or a 4.4 GHz CPU or whatever. With that "golden core" (aka AMD "Core Performance Order" or "Intel Turbo Boost Max 3.0") thing, the OS will prefer to schedule a single thread to that core so it can run faster.

    That does need OS support to query the hardware to find out which core is the "golden" core, capable of higher speeds.


    If you ran a primitive OS that was only designed for a single core, didn't try to start up other cores, it would only run on the "bootstrap" processor (in x86 terminology), which would be the same core every time the system booted. e.g. an ancient version of Linux, or one compiled without CONFIG_SMP.