chiark / gitweb /
meson: add -Dmemory-accounting-default=true|false
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 15 Feb 2018 10:43:08 +0000 (11:43 +0100)
committerSven Eden <yamakuzure@gmx.net>
Wed, 30 May 2018 05:58:56 +0000 (07:58 +0200)
This makes it easy to set the default for distributions and users which want to
default to off because they primarily use older kernels.

NEWS
meson.build
meson_options.txt
src/core/meson.build

diff --git a/NEWS b/NEWS
index df552f5f8a2bde091d4de3f9d258519ebb36059b..7f780f0007ece3d08ecbe7eda4c6bb1c98343115 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,15 +6,15 @@ CHANGES WITH 238 in spe:
           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.
+          enable this by default without affecting system performance. Besides
+          memory accounting only task 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. We recommend downstreams to leave memory
+          accounting on by default if kernel 4.14 or higher is are primarily
+          used. On very resource constrained systems or when support for old
+          kernels is a necessity, -Dmemory-accounting-default=false can be used
+          to revert this change.
 
 CHANGES WITH 237:
 
index 052a955e619651523f8202e8f4708c60cf333010..6d16024c3590eda2d0fbcc780d0ad4003a8f0fd7 100644 (file)
@@ -218,6 +218,8 @@ if pamconfdir == ''
         pamconfdir = join_paths(sysconfdir, 'pam.d')
 endif
 
+memory_accounting_default = get_option('memory-accounting-default')
+
 conf.set_quoted('PKGSYSCONFDIR',                              pkgsysconfdir)
 conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH',                    join_paths(pkgsysconfdir, 'system'))
 #if 0 /// UNNEEDED by elogind
@@ -275,6 +277,8 @@ conf.set_quoted('ROOTLIBEXECDIR',                             rootlibexecdir)
 # conf.set_quoted('USER_KEYRING_PATH',                          join_paths(pkgsysconfdir, 'import-pubring.gpg'))
 # conf.set_quoted('DOCUMENT_ROOT',                              join_paths(pkgdatadir, 'gatewayd'))
 #endif // 0
+conf.set('MEMORY_ACCOUNTING_DEFAULT',                         memory_accounting_default ? 'true' : 'false')
+conf.set_quoted('MEMORY_ACCOUNTING_DEFAULT_ON_OFF',           memory_accounting_default ? 'on' : 'off')
 
 conf.set_quoted('ABS_BUILD_DIR',                              meson.build_root())
 conf.set_quoted('ABS_SRC_DIR',                                meson.source_root())
@@ -321,6 +325,7 @@ substs.set('VARLOGDIR',                                       varlogdir)
 # substs.set('RC_LOCAL_SCRIPT_PATH_START',                      get_option('rc-local'))
 # substs.set('RC_LOCAL_SCRIPT_PATH_STOP',                       get_option('halt-local'))
 #endif // 0
+substs.set('MEMORY_ACCOUNTING_DEFAULT',                       memory_accounting_default ? 'yes' : 'no')
 
 #####################################################################
 
index 1b863721b6ec0697401d75d23b8750ee55c5eb1a..c08325567b9ae40ac896a779df774a05e2057c8c 100644 (file)
@@ -76,6 +76,8 @@ option('kexec-path', type : 'string', description : 'path to kexec')
 #        description : 'specify the tty device for debug shell')
 # option('debug', type : 'string',
 #        description : 'enable extra debugging (hashmap,mmap-cache)')
+# option('memory-accounting-default', type : 'boolean',
+#        description : 'enable MemoryAccounting= by default')
 #else
 option('debug', type : 'string',
        description : 'enable extra debugging (elogind,hashmap,mmap-cache)')
index 70831dd5711b233d7431de88217d27f99bccfd24..62e3f931ca1dce10ced2729156d2ef000fcfa3cb 100644 (file)
@@ -196,7 +196,8 @@ libcore_la_sources = files('''
 # 
 # in_files = [['macros.systemd',   rpmmacrosdir],
 #             ['triggers.systemd', ''],
-#             ['systemd.pc',       pkgconfigdatadir]]
+#             ['systemd.pc',       pkgconfigdatadir],
+#             ['system.conf',      pkgsysconfdir]]
 # 
 # foreach item : in_files
 #         file = item[0]
@@ -237,8 +238,7 @@ libcore_la_sources = files('''
 #endif // 0
 
 #if 0 /// totally UNNEEDED in elogind
-# install_data('system.conf',
-#              'user.conf',
+# install_data('user.conf',
 #              install_dir : pkgsysconfdir)
 # 
 # meson.add_install_script('sh', '-c', mkdir_p.format(systemshutdowndir))