Is it possible to manage access to CPU cores in a similar fashion that memory limiting works?
In particular I need to be able to dynamically create and destroy cgroups that will limit a particular set of processes to a desired number of CPU cores.
I cannot use CPU sets as this needs to work on multi-socket (upto small NUMA) machines and if I would hard pin processes to cores I would very quickly run into huge performance issues due to core fragmentation (the processes range from minutes to months in runtime).
Second complication is that this needs to play nicely with processes outside of the cgroups.
As an example I can have the following situation:
1 process limited to 2 cores and 4GB RAM
2 processes unlimited, but should have guaranteed access to the remainder of the machine