Re: [RFC PATCH 0/5] cgroup/cpuset: A new "isolcpus" paritition

From: Waiman Long
Date: Wed Apr 12 2023 - 16:34:17 EST


On 4/12/23 16:22, Tejun Heo wrote:
Hello, Waiman.

On Wed, Apr 12, 2023 at 03:52:36PM -0400, Waiman Long wrote:
There is still a distribution hierarchy as the list of isolation CPUs have
to be distributed down to the target cgroup through the hierarchy. For
example,

cgroup root
  +- isolcpus  (cpus 8,9; isolcpus)
  +- user.slice (cpus 1-9; ecpus 1-7; member)
    +- user-x.slice (cpus 8,9; ecpus 8,9; isolated)
+- user-y.slice (cpus 1,2; ecpus 1,2; member)

OTOH, I do agree that this can be somewhat hacky. That is why I post it as a
RFC to solicit feedback.
Wouldn't it be possible to make it hierarchical by adding another cpumask to
cpuset which lists the cpus which are allowed in the hierarchy but not used
unless claimed by an isolated domain?

I think we can. You mean having a new "cpuset.cpus.isolated" cgroupfs file. So there will be one in the root cgroup that defines all the isolated CPUs one can have. It is then distributed down the hierarchy and can be claimed only if a cgroup becomes an "isolated" partition. There will be a slight change in the semantics of an "isolated" partition, but I doubt there will be much users out there.

If you are OK with this approach, I can modify my patch series to do that.

Cheers,
Longman