[systemd-devel] implies "MemoryAccounting=true"
Gao feng
gaofeng at cn.fujitsu.com
Wed Sep 11 19:06:44 PDT 2013
On 09/11/2013 08:07 PM, Lennart Poettering wrote:
> On Wed, 11.09.13 09:18, Gao feng (gaofeng at cn.fujitsu.com) wrote:
>
>>>> The SYSTEMD.CGROUP(5) said if MemoryLimit=bytes is set for unit, it
>>>> implies MemeoryAccounting=true for this unit.
>>>>
>>>> But seems systemd didn't implement this hint. CPUShares & BlockIO have
>>>> the same problem, this is a shortage? patch needed?
>>>
>>>
>>> The logic for this is in src/core/cgroup.c's cgroup_context_get_mask()
>>> call, which will determine to which cgroup controllers to add a unit
>>> to. Note that setting MemoryLimit= will not actually propagate to the
>>> boolean exposed in MemoryAccounting=, it will just have the same effect
>>> as if it was set...
>>>
>>
>> Maybe we should also report "MemoryAccounting=yes" in cgroup_context_dump
>> if we set MemoryLimit.
>
> What I don't really like about this is that we allow MemoryLimit to be
> altered dynamically, which would then need to influence
> MemoryAccounting= dynamically too. WHich means that we would have to
> shadow that field so that we can revert to the originally configured
> value. Also, it would have very weird effects if people then try to
> dynamically unset MemoryAccounting which would either possibly be a NOP
> or would have the effect of resseting MemoryLimit... If you follow what
> I mean.
>
make sense, thanks for your explanation :)
More information about the systemd-devel
mailing list