tuna: RFC: Use cpusets to isolate cpus

Use cpusets to isolate cpus

This is a proof of concept, some more work would have to be done
especially in tuna to deal with situations such as attempting to create a new
isolated cpuset when one already exists, and so on.

After running the following command on a machine with no cpusets

su -c './tuna-cmd.py -c "5-7" -i'

We have the base cpuset which by convention is mounted here /dev/cpuset
and we have
cpuset 'tuna0' which has all the cpus that were not to be isolated
cpuset 'tuna1' which has all the cpus that were to be isolated
and tuna1 is a cpu_exclusive set

All the tasks that were migratable from the base cpuset are now in tuna0
and no tasks are in tuna1

ls -ld /dev/cpuset
dr-xr-xr-x. 4 root root 0 Nov  8 15:20 /dev/cpuset
[root@fionn ~]# cd /dev/cpuset
[root@fionn cpuset]# cat tuna0/cpus
[root@fionn cpuset]# cat tuna1/cpus
[root@fionn cpuset]# cat tuna0/cpu_exclusive
[root@fionn cpuset]# cat tuna1/cpu_exclusive

Some tasks are not migrate-able, after the migration
There are (as an example)

138 tasks that couldn't be migrated
971 that were migrated
and 0 in the new cpuset with the isolated cpus

[jkacur@fionn tuna]$ cat /dev/cpuset/tasks  | wc -l
[jkacur@fionn tuna]$ cat /dev/cpuset/tuna0/tasks | wc -l
[jkacur@fionn tuna]$ cat /dev/cpuset/tuna1/tasks | wc -l

The programmer could now use affinity to run new tasks on the isolated

pushed to branch devel/cpusets so folks can try it out.

Signed-off-by: John Kacur <jkacur@redhat.com>
2 files changed