Reply To: How to verify process affinity?

Home Forums Using vSMP Foundation How to verify process affinity? Reply To: How to verify process affinity?

#3049

Tal
Participant

Hi Kevin,

The easiest way to find the CPU affinity of a process is using the taskset command:

taskset -pc <pid>

will report the CPU affinity as a list of the CPU numbers.

taskset -p <pid>

will report the CPU affinity as a mask of the CPUs included.

If you are looking for the information in /proc, check the file /proc/<pid>/status.
The lines you are looking for are (as in this example):

Cpus_allowed: 0100
Cpus_allowed_list: 8

I hope this helps (/proc information may not be available in all kernels).

Tal Nevo
ScaleMP Inc.