Your result is normal. Don't forget that ```Cpus_allowed_list``` displays the mask value of ```Cpus_allowed``` (which will be ```ffff``` in your case, or all cpu's). The taskset just gives the correct number instead of a mask. This function will do exactly the same (hence first a call to ````get_core_count```.

Futhermore, the ```Cpus_allowed_list``` is always present (since kernel 2.6.18 or something), even if cgroups is not active. When cgroups (cpusets) are active, the value of ```Cpus_allowed``` is updated accordingly else it follows tasksets affinity.

In case that cpusets and tasksets affinity don't match, the cpusets take precedence. In principle, ```sched_getaffinity()``` can report the wrong value. (at least, I think so).