Pinned to CPUs 0-7 but running only on 2-3: how Linux cpusets narrow your affinity mask
The kernel silently intersects your sched_setaffinity mask with the CPUs your cpuset/cgroup allows and the CPUs that exist. How to see the real set and diagnose EINVAL, per the man pages.
linuxcpu-affinitycgroupscheduler