[systemd-devel] Question: who should set up the cpuset cgroup

Lennart Poettering lennart at poettering.net
Tue Sep 17 08:45:09 PDT 2013


On Mon, 16.09.13 11:17, Gao feng (gaofeng at cn.fujitsu.com) wrote:

> Hi
> 
> I'm working on adding set cpuset cgroup support for systemd.
> this work almost finished. but I faced a problem.
> 
> As we know, if we create a machine,the cgroup for this machine
> will be created as well. and the cgroup of this machine is a
> sub-directory of machine.slice(or other slices..). And if the
> cpuset of machine.slice is unset. the setting of cpuset for this
> machine will failed. since the cpuset.mems and cpuset.cpus of
> machine.slice is null.
> 
> The question is who should set up the cpuset cgroup of machine.slice?
> 
> 1, set up when systemd creates cpuset cgroup for machine.slice?
> 2, the programs which create the machines?
> 3, other ideas? kernel?

I have the suspicion that we need to propagate this down from the root
of the hierarchy as soon as a leaf sets a cpu set.

Let's say the root has enabled all cpus (which is the default after
all), and you enable only a subset for a leaf 2 levels down, but do not
specify anything for the slice that is in the middle, then the cpuset of
the root should be propagated down.
  
Consider this hierarchy:

            -.slice 
           /       \
          /         \
machine.slice    systemd.slice
         |
         |
machine-customer1.slice
         |
         |
     a.scope

If a.scope gets a cpuset assigned, and neither machine.slice nor
machine-customer1.slice have any, then the cpuset of -.slice should be
inherited into machine.slice and then further into
machine-customer1.slice, if you follow what I mean?

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list