[systemd-devel] [PATCH 1/3] Enable systemd to set/show limit of memory+Swap usage

Lennart Poettering lennart at poettering.net
Tue Sep 17 08:36:33 PDT 2013


On Tue, 17.09.13 14:21, Chen Hanxiao (chenhanxiao at cn.fujitsu.com) wrote:

> From: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
> 
> @@ -89,6 +89,7 @@ $1.CPUAccounting,                config_parse_bool,                  0,
>  $1.CPUShares,                    config_parse_cpu_shares,            0,                             offsetof($1, cgroup_context)
>  $1.MemoryAccounting,             config_parse_bool,                  0,                             offsetof($1, cgroup_context.memory_accounting)
>  $1.MemoryLimit,                  config_parse_memory_limit,          0,                             offsetof($1, cgroup_context)
> +$1.MemorySWLimit,                config_parse_memory_limit,          0,                             offsetof($1, cgroup_context)
>  $1.MemorySoftLimit,              config_parse_memory_limit,          0,                             offsetof($1, cgroup_context)
>  $1.DeviceAllow,                  config_parse_device_allow,          0,                             offsetof($1, cgroup_context)
>  $1.DevicePolicy,                 config_parse_device_policy,         0,                             offsetof($1, cgroup_context.device_policy)

OK, so here's another idea: I have the strong suspicion that people are
much more likely using the new limit that includes the swap than the
current MemoryLimit= that doesn't.

Hence, to make this simpler, I'd propose to simply swap things around:

MemoryLimit= would start writing to memory.memsw.limit_in_bytes. And a
new MemoryRAMLimit= would controler the original memory.limit_in_bytes?

This shifts things around a bit but I think it would be much nicer to
use?

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list