Linux and processor affinity
I just encountered a new concept today, 'processor affinity', which is related to how the processes in a system utilizes the available sockets/cpus/cores of a hardware. This made me think about how Linux could utilize the available resources of a system.
Since I am not that much familiar with how the linux kernel works on hardware, I came up with the following questions:
1. As I add more CPUs or upgrade an existing CPU with more cores, would the kernel automatically recognize the changes and utilize all available resources?
2. If not, should I be making any tweaks, probably recompile the kernel?
3. Suppose my CPU utilization is 50% on only 1 core of 1 CPU, and I have 4 CPUs with 4 cores each, is it safe that i set the processor affinity of my OS to utilize all the CPUs and all their cores? Would this affect the processes owned by the applications running on my system?
4. Or is there any need to do #3?