]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pid1: turn memory accounting on by default now
authorLennart Poettering <lennart@poettering.net>
Fri, 9 Feb 2018 18:59:53 +0000 (19:59 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 9 Feb 2018 19:06:33 +0000 (20:06 +0100)
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.

NEWS
man/systemd-system.conf.xml
src/core/main.c
src/core/manager.c
src/core/system.conf

diff --git a/NEWS b/NEWS
index 2021a23501eec3acf495044143c1b36e0fe51b2e..b799c19f3bf9f10f0b4473ccecc64fb6394f8370 100644 (file)
--- 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
index 08f6c91901c59830b2b84d60bacaa93d23689477..d875a3c46fc42c4907cc6cb9d439cc7a7d9cb324 100644 (file)
         <varname>CPUAccounting=</varname>, <varname>BlockIOAccounting=</varname>, <varname>MemoryAccounting=</varname>,
         <varname>TasksAccounting=</varname> and <varname>IPAccounting=</varname>. See
         <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
-        for details on the per-unit settings. <varname>DefaultTasksAccounting=</varname> defaults to on, the other
-        four settings to off.</para></listitem>
+        for details on the per-unit settings. <varname>DefaultTasksAccounting=</varname> and
+        <varname>DefaultMemoryAccounting=</varname> default to on, the other three settings to off.</para></listitem>
       </varlistentry>
 
       <varlistentry>
index 56200a8fad313311583910e5b70823672f120627..f518656af33eab618175c3fb6ea87c0ed67cfabc 100644 (file)
@@ -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 = {};
index 5021e00b870e4ababc3f569bc1bebec91452facd..27b041c6d27f58c41d49aeda9f2219d817ef152a 100644 (file)
@@ -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;
index 6b86eac33db0005ce6f0b64267e5da4f43be40a7..51a6e83ecf16b9ac61af7b0c66ba6319528e8a6f 100644 (file)
@@ -42,7 +42,7 @@
 #DefaultIOAccounting=no
 #DefaultIPAccounting=no
 #DefaultBlockIOAccounting=no
-#DefaultMemoryAccounting=no
+#DefaultMemoryAccounting=yes
 #DefaultTasksAccounting=yes
 #DefaultTasksMax=15%
 #DefaultLimitCPU=