Can someone tell me what the dependencies are, for a Linux installation to support setting the CPU affinity of a process via sched_setaffinity(…), or thread via pthread_setaffinity_np(…)?
In the manpages of sched_setaffinity, this page is referenced: cpuset. There it says, there should be a “nodev cpuset” in /proc/filesystems, if CPUSET is supported.
On both systems I tested, the iMX6 (kernel 4.1) and the TK1 (kernel 3.10), it’s not there. Then I found that the option CONFIG_CPUSET is disabled in the linux config (according to /proc/config.gz), of both systems.
So it should be not supported on both, right?
But on the iMX6, both setaffinity calls above succeed and I do see the effect in htop, the second core doig much more than without the call.
But on the TK1, the call returns unsuccessfully.
Normally my guess would be I’d need to build a new Linux image with that option enabled. But the relation between the presence indicator for CPUSET support, and it actually working seems to be different than I so far gathered from the manpages.
Hence, I’d be glad if someone could tell me definitely what’s really going on here, before I go to such efforts in vain