|
|
By default, the scheduler does not gives preference to a process that last executed on a CPU. The advantage of giving preference to these processes is to improve the hit rate on the level-one (L1) cache and L2 caches. As a consequence, the hardware is less likely to have to reload the caches from memory, an action that could slow down the processor. It also means that the process selected to run does not necessarily have the highest priority.
Cache affinity behavior is controlled by the value of the variable cache_affinity. If the value of cache_affinity is changed to 1, the kernel gives preference to processes which previously ran on a CPU Valid data and text is more likely to be found in the caches for small processes. If your system tends to run large processes leave cache_affinity set to 0.