Eu tenho uma máquina de 40 v core na qual um processo java está sendo executado. Eu posso ver que este processo está sendo executado em cpu6 o tempo todo.
$watch ps -o pid,psr,comm -p 4076
Every 2.0s: ps -o pid,psr,comm -p 4076 Mon Apr 11 02:24:12 2016
PID PSR COMMAND
4076 6 java
$ sudo taskset -c -p 4076
pid 4076's current affinity list: 0-39
$ sudo taskset -p 4076
pid 4076's current affinity mask: ffffffffff
Isto é como o comando top para a utilização da CPU parece
$ top -c
top - 02:27:37 up 47 days, 10:49, 9 users, load average: 2.83, 2.89, 3.01
Tasks: 470 total, 1 running, 469 sleeping, 0 stopped, 0 zombie
%Cpu0 : 36.0 us, 8.3 sy, 0.0 ni, 40.7 id, 8.7 wa, 0.0 hi, 6.3 si, 0.0 st
%Cpu1 : 1.3 us, 0.7 sy, 0.0 ni, 97.7 id, 0.3 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu2 : 0.3 us, 0.3 sy, 0.0 ni, 99.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu3 : 0.7 us, 0.7 sy, 0.0 ni, 98.0 id, 0.7 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu4 : 1.4 us, 1.0 sy, 0.0 ni, 97.3 id, 0.3 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu5 : 1.0 us, 1.3 sy, 0.0 ni, 97.0 id, 0.7 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu6 : 0.3 us, 0.3 sy, 0.0 ni, 99.0 id, 0.3 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu7 : 0.3 us, 0.0 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu8 : 0.3 us, 0.0 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu9 : 1.0 us, 1.0 sy, 0.0 ni, 97.7 id, 0.3 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu10 : 0.7 us, 0.7 sy, 0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97.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu26 : 0.7 us, 0.3 sy, 0.0 ni, 99.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu27 : 0.3 us, 0.7 sy, 0.0 ni, 98.7 id, 0.3 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu28 : 0.3 us, 0.7 sy, 0.0 ni, 98.7 id, 0.3 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu29 : 0.7 us, 0.7 sy, 0.0 ni, 98.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu30 : 1.0 us, 0.3 sy, 0.0 ni, 98.3 id, 0.3 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu31 : 1.0 us, 0.7 sy, 0.0 ni, 98.0 id, 0.3 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu32 : 0.7 us, 0.0 sy, 0.0 ni, 99.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu33 : 0.0 us, 0.3 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu34 : 0.7 us, 0.3 sy, 0.0 ni, 99.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu35 : 0.7 us, 0.0 sy, 0.0 ni, 99.0 id, 0.3 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu36 : 0.0 us, 0.3 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
O Cpu6 está ocioso na maior parte do tempo, conforme você o vê no comando principal. Portanto, o processo de agendamento no mesmo processador é possível e ajudará a reduzir a invalidação do cache. Mas como o agendador está fazendo tudo isso? Ele está acompanhando cada processo e seu último processador executado?