cpuset: Support CPU Isolation toggle on v2 root partitions

Introduce a new "cpu_isolation" file within a cgroup2/cpuset
directory which provides support for a set of CPUs to either enable ("1")
or disable ("0") CPU Isolation. This can overwrite previous boot
settings towards "nohz_full=" kernel parameter.

The file is only writeable on "root" or "isolated" type partitions to
exclude any overlap. The deepest root type partition has the highest
priority. This means that given the following setting:

                    Top cpuset (CPUs: 0-7)
                    cpuset.cpu_isolation = 0
                              |
                              |
                    Subdirectory A (CPUs: 5-7)
                    cpuset.cpus.partition = root
                    cpuset.cpu_isolation = 0
                              |
                              |
                    Subdirectory B (CPUs: 7)
                    cpuset.cpus.partition = root
                    cpuset.cpu_isolation = 1

the result is that only CPU 7 is in rcu_nocb mode.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Cc: Zefan Li <lizefan.x@bytedance.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Paul E. McKenney <paulmck@kernel.org>
Cc: Phil Auld <pauld@redhat.com>
Cc: Nicolas Saenz Julienne <nsaenz@kernel.org>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Waiman Long <longman@redhat.com>
Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
1 file changed