From: Lennart Poettering Date: Fri, 9 Feb 2018 18:59:53 +0000 (+0100) Subject: pid1: turn memory accounting on by default now X-Git-Tag: v238~99^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e0c46a736412b79b94a21f8512a769b9212b9adf;p=thirdparty%2Fsystemd.git pid1: turn memory accounting on by default now After discussions with @htejun it appears it's OK now to enable memory accounting by default for all units without affecting system performance too badly. facebook has made good experiences with deploying memory accounting across their infrastructure. This hence turns MemoryAccounting= from opt-in to opt-out, similar to how TasksAccounting= is already handled. The other accounting options remain off, their performance impact is too big still. --- diff --git a/NEWS b/NEWS index 2021a23501e..b799c19f3bf 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,21 @@ systemd System and Service Manager +CHANGES WITH 238 in spe: + + * The MemoryAccounting= unit property now defaults to on. After + discussions with the upstream control group maintainers we learnt + that the negative impact of cgroup memory accounting on current + kernels is finally relatively minimal, so that it should be safe to + enable this by default without affecting system performance too + much. Besides memory accounting only tasks accounting is turned on by + default, all other forms of resource accounting (CPU, IO, IP) remain + off for now, because it's not clear yet that their impact is small + enough to move from opt-in to opt-out for them, too. We recommend + downstreams to leave memory accounting on by default, however in some + situations it might be wise to revert this change of defaults, in + particular on very resource constrained systems or when support for + old kernels is a necessity. + CHANGES WITH 237: * Some keyboards come with a zoom see-saw or rocker which until now got diff --git a/man/systemd-system.conf.xml b/man/systemd-system.conf.xml index 08f6c91901c..d875a3c46fc 100644 --- a/man/systemd-system.conf.xml +++ b/man/systemd-system.conf.xml @@ -338,8 +338,8 @@ CPUAccounting=, BlockIOAccounting=, MemoryAccounting=, TasksAccounting= and IPAccounting=. See systemd.resource-control5 - for details on the per-unit settings. DefaultTasksAccounting= defaults to on, the other - four settings to off. + for details on the per-unit settings. DefaultTasksAccounting= and + DefaultMemoryAccounting= default to on, the other three settings to off. diff --git a/src/core/main.c b/src/core/main.c index 56200a8fad3..f518656af33 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -135,7 +135,7 @@ static bool arg_default_cpu_accounting = false; static bool arg_default_io_accounting = false; static bool arg_default_ip_accounting = false; static bool arg_default_blockio_accounting = false; -static bool arg_default_memory_accounting = false; +static bool arg_default_memory_accounting = true; static bool arg_default_tasks_accounting = true; static uint64_t arg_default_tasks_max = UINT64_MAX; static sd_id128_t arg_machine_id = {}; diff --git a/src/core/manager.c b/src/core/manager.c index 5021e00b870..27b041c6d27 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -673,6 +673,7 @@ int manager_new(UnitFileScope scope, unsigned test_run_flags, Manager **_m) { m->unit_file_scope = scope; m->exit_code = _MANAGER_EXIT_CODE_INVALID; m->default_timer_accuracy_usec = USEC_PER_MINUTE; + m->default_memory_accounting = true; m->default_tasks_accounting = true; m->default_tasks_max = UINT64_MAX; m->default_timeout_start_usec = DEFAULT_TIMEOUT_USEC; diff --git a/src/core/system.conf b/src/core/system.conf index 6b86eac33db..51a6e83ecf1 100644 --- a/src/core/system.conf +++ b/src/core/system.conf @@ -42,7 +42,7 @@ #DefaultIOAccounting=no #DefaultIPAccounting=no #DefaultBlockIOAccounting=no -#DefaultMemoryAccounting=no +#DefaultMemoryAccounting=yes #DefaultTasksAccounting=yes #DefaultTasksMax=15% #DefaultLimitCPU=