0

I am trying to make a stable environment for benchmarking
So I need to isolate cpu (no other processes use an isolated one)
I cannot use cset (works with cgroup v1 only) and I cannot use isolcpus (forbidden by a security policy).

As far as I can see - the only choice is making a cgroup v2 with an isolated cpu.
I read the cgroup v2 docs: https://docs.kernel.org/admin-guide/cgroup-v2.html
It tells the following in 'cpuset.cpus.partition' part:

When set to "isolated", the CPUs in that partition 
root will be in an isolated state without any load balancing from the scheduler. 
Tasks placed in such a partition with multiple CPUs 
should be carefully distributed and bound 
to each of the individual CPUs for optimal performance.

But when I am trying to set it cpuset.cpus.partition to 'isolated' I get Invalid argument error.
Details:
OS: Ubuntu 22.04
Group creation:

sudo cgcreate -g cpu:benchmark -g cpuset:benchmark

cpuset.cpus: 0
cpuset.cpus.effective: 0
cpuset.mems: 0
cpuset.mems.effective: 0

Error:

sudo cgset -r cpuset.cpus.partition=isolated benchmark
cgset: cgroup modify error: Invalid argument 

sudo bash -c 'echo 'isolated' > cpuset.cpus.partition' 
bash: line 1: echo: write error: Invalid argument

I would appreciate any help

Vladimir Tsyshnatiy
  • 989
  • 1
  • 10
  • 20

0 Answers0