Set CPU Affinity

Now let's try to set process in to a specify CPU. For example, we have a process has PID = 14846 Let's see the CPU affinity list of this process first:

$ taskset -cp 14846
pid 14846's current affinity list: 0-15

#Change CPU affinity to 1:

$ taskset -cp 1 14846
pid 14846's current affinity list: 0-15
pid 14846's new affinity list: 1

As we see, CPU affinity was changed

Comments