1

when I run taskset -p 242306 I got following output

3ffffffffffc000000000000000000000000000000000000000000038000000

sorry for the long string, there are 256 cores on the box.

used taskset -c -p 242306 the output is

pid 242306's current affinity list: 27-29,206-249

but when I run ps -u <uid> -o pid,cpuid | grep 242306 I got 242306 131 so the process is actually running on cpu 131 which is disabled in mask above

the cpu affinity is set by using cgroup, and the process is ssh-agent. the operating system is Oracle Linux Server release 7.9.

one thing worth mentioning is that the process is not really running, it's not consuming any cpu. so maybe the system will randomly assign a cpu core to a process when it's not really using any cpu?

Lei Yu
  • 11
  • 2
  • `sorry for the long string, there are 256 cores on the box.` 252 bits in that string :p so, which bit represents "131"? – Jaromanda X Jul 20 '23 at 04:07
  • @JaromandaX the first 0 on the right represents processor 0,1,2,3. the second 0 represents 4,5,6,7. so 131 is represented by the 33rd number from the right which is 0. I used taskset -c to get the easy to read output. added that in the answer – Lei Yu Jul 20 '23 at 07:53
  • 1
    perhaps it's in the digit you are missing in your question - oh, perhaps leading zero is missing ... fair enough – Jaromanda X Jul 20 '23 at 07:56

0 Answers0