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?