I would put the cpuset part before the cpuinfo part. For most (modern) systems, cpusets will be active, so the cpuset part will suffice to get the cpu number. The cpuinfo part is than the 'fallback'.