Multiple-Processor Scheduling

Processors contain cache memory, which speeds up repeated accesses to the same memory locations.

If the operating system were to switch a process from one CPU to another, this would require the entire cache to be copied over.

As such, operating system use processor affinity, which is some form of binding a process to a particular CPU.

Soft affinity occurs when the system attempts to keep processes on the same processor but makes no guarantees.

Hard affinity is a guarantee that a process won't switch to other CPUs. Linux uses hard affinity (there's a C function that does so: sched_setaffinity().)