you do not necessarily turn off or disable cores.
you would use cpusets and taskset
A cpuset defines a list of CPUs and memory nodes...
The cpuset filesystem is a pseudo-filesystem interface to the kernel cpuset mechanism, which is used to control the processor placement and memory placement of processes. It is commonly mounted at /dev/cpuset.
On systems with kernels compiled with built in support for cpusets, all processes are attached to a cpuset, and cpusets are always present. If a system supports cpusets, then it will have the entry nodev cpuset in the file /proc/filesystems. By mounting the cpuset filesystem (see the EXAMPLE section below), the administrator can configure the cpusets on a system to control the processor and memory
placement of processes on that system. By default, if the cpuset
configuration on a system is not modified or if the cpuset filesystem is not even mounted, then the cpuset mechanism, though present, has no effect on the system's behavior.
The CPUs of a system include all the logical processing units on which a process can execute, including, if present, multiple processor cores within a package and Hyper-Threads within a processor core. Memory nodes include all distinct banks of main memory; small and SMP systems typically have just one memory node that contains all the system's main memory, while NUMA (non-uniform memory access) systems have multiple memory nodes.
In short, if you have 1 cpu having 6 cores you would configure cpusets and launch your process in a cpuset that is configured on just one core, say core #3 for example. If it was a parallel process it would all be confined to that one core such that if you launched 4 processes in a given cpuset having just one core defined, then each of the 4 processes would get 25% cpu utilization on core #3.
Building off of that, what typically happens is a cpuset is configured such that
- in a 200+ core system for example, cpusetA is cores 0..60 wherever those might be located, cpusetB is cores 61..70; cpusetC is cores 71..80; and so on however an admin/architect chooses to configure.
- cpusetA is allocated to certain users and/or specific software programs; cpusetB is allocated to different users/programs; and so on.
- a user launches a job (process) which would request N cores... within a given cpuset, and now those multiple (parallel) processes are confined to that given cpuset. And for those N parallel confined to a given cpuset, each of those processes would/should make use of processor affinity or cpu affinity so those parallel processes do not thrash around on different cores within the cpuset.