Possible unintended side-effect: `taskset -p` might have "interesting" effects on your process.
Also, the "sleep for 1 ms" approach used in `init()` looks wrong -- if `sched_setaffinity()` doesn't guarantee that the calling task has been migrated to one of the target CPUs on return (which I suspect it does), I don't think sleeping for a millisecond is going to change anything.
Yeah, the sleep is a leftover from an earlier version of the code that didn't use sched_setaffinity. I've remove it now.