Linux: how to know which processes are pinned to which core?

Under normal circumstances Linux processes are not explicitly pinned to a given core, there's typically no reason to do that, but is possible.

You can manage process affinity using taskset or view which process runs on which CPU in the present instant using ps with the field 'psr'.

Check current CPU affinity of process 27395:

$ ps -o psr 27395
PSR
  6

Check affinity list of process 27395:

$ taskset -pc 27395
pid 27395's current affinity list: 0-7

Set affinity of process 27395 to CPU 3

$ taskset -pc 3 27395
pid 27395's current affinity list: 0-7
pid 27395's new affinity list: 3

Check current CPU affinity of process 27395:

$ ps -o psr 27395
PSR
  3

To check if any process is pinned to any CPU, you can loop through your process identifiers and run taskset -p against them:

$ for pid in $(ps -a -o pid=); do taskset -pc $pid 2>/dev/null; done
pid 1803's current affinity list: 0-7
pid 1812's current affinity list: 0-7
pid 1986's current affinity list: 0-7
pid 2027's current affinity list: 0-7
pid 2075's current affinity list: 0-7
pid 2083's current affinity list: 0-7
pid 2122's current affinity list: 0-7
pid 2180's current affinity list: 0-7
pid 2269's current affinity list: 0-7
pid 2289's current affinity list: 0-7
pid 2291's current affinity list: 0-7
pid 2295's current affinity list: 0-7
pid 2300's current affinity list: 0-7
pid 2302's current affinity list: 0-7
pid 3872's current affinity list: 0-7
pid 4339's current affinity list: 0-7
pid 7301's current affinity list: 0-7
pid 7302's current affinity list: 0-7
pid 7309's current affinity list: 0-7
pid 13972's current affinity list: 0-7