[systemd-devel] regarding to cgroup siblings mask

WaLyong Cho walyong.cho at samsung.com
Thu Mar 26 19:33:21 PDT 2015


On 03/27/2015 05:33 AM, David Timothy Strauss wrote:
> On Tue, Mar 24, 2015 at 4:29 AM, WaLyong Cho <walyong.cho at samsung.com> wrote:
>> Could anyone explain why?
> 
> An admin using CPUShares= or a similar proportional CGroup controller
> probably assumes that setting the shares to twice the default (for
> example) increases the relative proportion of resources for that unit.
> However, that is only true if other units competing for that resource
> have the same controller(s) enabled so that the kernel knows to
> balance the resources accordingly.
> 
> The code in systemd ensures that if any unit uses a proportional
> CGroups controller in a slice, all other units in that same slice
> enable that controller as well, usually with the default proportions.

Thanks, understood. But I think this propagation is needed only for
taking weight argument such like CPUShares=weight,
StartupCPUShares=weight, BlockIOWeight=weight,
StartupBlockIOWeight=weight, BlockIODeviceWeight=device weight. For
example, I don't think MemoryLimit= is not option of proportional. It
just only limit of its cgroup and does not race with other cgroup.

If I'm right, we need to modify unit_get_target_mask() to get only mask
for proportional properties.

> 
> unit_get_target_mask() is part of an optimization I added so that
> initializing CGroups controllers for a given unit doesn't require
> iterating through every other unit in a slice to figure out the
> necessary controllers. It provides a bitmask indicating the
> controllers in use by its siblings so the unit can enable, say,
> CPUShares= if one of its siblings is doing so.
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> 


More information about the systemd-devel mailing list