Systemd/src/test
Chris Down c52db42b78 cgroup: Implement default propagation of MemoryLow with DefaultMemoryLow
In cgroup v2 we have protection tunables -- currently MemoryLow and
MemoryMin (there will be more in future for other resources, too). The
design of these protection tunables requires not only intermediate
cgroups to propagate protections, but also the units at the leaf of that
resource's operation to accept it (by setting MemoryLow or MemoryMin).

This makes sense from an low-level API design perspective, but it's a
good idea to also have a higher-level abstraction that can, by default,
propagate these resources to children recursively. In this patch, this
happens by having descendants set memory.low to N if their ancestor has
DefaultMemoryLow=N -- assuming they don't set a separate MemoryLow
value.

Any affected unit can opt out of this propagation by manually setting
`MemoryLow` to some value in its unit configuration. A unit can also
stop further propagation by setting `DefaultMemoryLow=` with no
argument. This removes further propagation in the subtree, but has no
effect on the unit itself (for that, use `MemoryLow=0`).

Our use case in production is simplifying the configuration of machines
which heavily rely on memory protection tunables, but currently require
tweaking a huge number of unit files to make that a reality. This
directive makes that significantly less fragile, and decreases the risk
of misconfiguration.

After this patch is merged, I will implement DefaultMemoryMin= using the
same principles.
2019-04-12 17:23:58 +02:00
..
generate-sym-test.py Mark python scripts executable 2017-05-07 20:16:47 -04:00
meson.build cgroup: Implement default propagation of MemoryLow with DefaultMemoryLow 2019-04-12 17:23:58 +02:00
test-acl-util.c util-lib: split out all temporary file related calls into tmpfiles-util.c 2018-12-02 13:22:29 +01:00
test-af-list.c util: make *_from_name() returns negative errno on error 2018-11-28 20:20:50 +09:00
test-alloc-util.c test-alloc-util: add a smoke test for greedy_realloc 2019-03-20 13:17:27 +01:00
test-architecture.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-arphrd-list.c tree-wide: drop several missing_*.h and import relevant headers from kernel-5.0 2019-04-11 19:00:37 +02:00
test-ask-password-api.c ask-password: check keyring in ask_password_tty and ask_password_agent 2018-10-31 18:26:58 +01:00
test-async.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-barrier.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-bitmap.c tree-wide: drop copyright headers from frequent contributors 2018-06-20 11:58:53 +02:00
test-boot-timestamps.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-bpf.c tree-wide: drop several missing_*.h and import relevant headers from kernel-5.0 2019-04-11 19:00:37 +02:00
test-btrfs.c tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
test-bus-util.c bus-util: drop now-unused functions 2018-09-20 16:52:02 +02:00
test-calendarspec.c tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
test-cap-list.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-capability.c capability: add a test that fails if we ever enter > 64bit capability territory 2019-03-21 12:38:18 +01:00
test-cgroup-cpu.c core: add CPUQuotaPeriodSec= 2019-02-14 11:04:42 -08:00
test-cgroup-mask.c cgroup: Add DisableControllers= directive to disable controller in subtree 2018-12-03 15:40:31 +00:00
test-cgroup-unit-default.c cgroup: Implement default propagation of MemoryLow with DefaultMemoryLow 2019-04-12 17:23:58 +02:00
test-cgroup-util.c cgroup: Imply systemd.unified_cgroup_hierarchy=1 on cgroup_no_v1=all 2018-12-21 13:29:27 +00:00
test-cgroup.c tree-wide: add whitespace between type and variable name 2018-12-04 09:29:54 +01:00
test-chown-rec.c core: drop suid/sgid bit of files/dirs when doing recursive chown 2019-03-26 08:29:37 +01:00
test-clock.c util-lib: split out all temporary file related calls into tmpfiles-util.c 2018-12-02 13:22:29 +01:00
test-condition.c tests: add tests for ConditionMemory= + ConditionCPUs 2019-03-19 15:55:08 +01:00
test-conf-files.c tmpfiles: fix crash with NULL in arg_root and other fixes and tests 2018-12-20 09:56:51 +01:00
test-conf-parser.c test: add testcases for the lines prefixed with whitespaces 2019-01-08 14:12:22 +09:00
test-copy.c util-lib: when copying files make sure to apply some chattrs early, some late 2019-03-28 18:43:04 +01:00
test-cpu-set-util.c tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
test-daemon.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-date.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-dev-setup.c util-lib: split out all temporary file related calls into tmpfiles-util.c 2018-12-02 13:22:29 +01:00
test-device-nodes.c tree-wide: drop copyright lines for more authors 2018-06-22 16:39:45 +02:00
test-dissect-image.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-dlopen.c Drop my copyright headers 2018-06-14 13:03:20 +02:00
test-dns-domain.c resolve: reject host names with leading or trailing dashes in /etc/hosts 2018-12-10 09:56:56 +01:00
test-ellipsize.c tree-wide: drop copyright headers from frequent contributors 2018-06-20 11:58:53 +02:00
test-emergency-action.c units: allow and use SuccessAction=exit-force in system systemd-exit.service 2018-10-17 19:32:07 +02:00
test-engine.c core: add new API for enqueing a job with returning the transaction data 2019-03-27 12:37:37 +01:00
test-env-util.c test-env-util: allow $PATH to be unset 2019-04-12 09:05:02 +02:00
test-escape.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-exec-util.c test-exec-util: do not call setenv with NULL arg 2019-04-12 09:05:02 +02:00
test-execute.c test-execute: skip flaky test when we can't unshare namespaces 2019-03-26 18:53:53 +01:00
test-extract-word.c tree-wide: drop copyright headers from frequent contributors 2018-06-20 11:58:53 +02:00
test-fd-util.c util: split out memcmp()/memset() related calls into memory-util.[ch] 2019-03-13 12:16:43 +01:00
test-fdset.c util-lib: split out all temporary file related calls into tmpfiles-util.c 2018-12-02 13:22:29 +01:00
test-fileio.c Add fmemopen_unlocked() and use unlocked ops in fuzzers and some other tests 2019-04-12 11:44:57 +02:00
test-firewall-util.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-format-table.c tree-wide: specify all table headers in lower-case 2018-12-03 22:42:38 +01:00
test-fs-util.c test-fs-util: test chase_symlinks with user-owned dirs 2019-02-28 13:06:07 -05:00
test-fstab-util.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-gcrypt-util.c Fix SPDX license tags 2018-06-14 13:05:41 +02:00
test-glob-util.c util-lib: split out all temporary file related calls into tmpfiles-util.c 2018-12-02 13:22:29 +01:00
test-hash.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-hashmap-ordered.awk meson: also indent scripts with 8 spaces 2017-04-25 08:49:16 -04:00
test-hashmap-plain.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-hashmap.c test-hashmap: add test to compare hashmap_free performance 2018-12-18 12:04:08 +01:00
test-helper.c tests: skip test_exec_ambientcapabilities on Travis CI under ASan 2018-11-20 20:23:19 +01:00
test-helper.h tests: skip test_exec_ambientcapabilities on Travis CI under ASan 2018-11-20 20:23:19 +01:00
test-hexdecoct.c Delete duplicate lines 2019-01-12 16:02:26 +01:00
test-hostname-util.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-hostname.c tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
test-id128.c sd-id128: expose ID128_UUID_FORMAT_STR 2019-04-05 13:47:54 +02:00
test-in-addr-util.c test: add tests for test_in_addr_prefix_to_string() 2019-03-04 23:45:07 +09:00
test-install-root.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-install.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-io-util.c tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
test-ip-protocol-list.c test: add tests for ip_protocol_{from,to}_name() 2018-12-02 06:13:47 +01:00
test-ipcrm.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-job-type.c tree-wide: add whitespace between type and variable name 2018-12-04 09:29:54 +01:00
test-journal-importer.c tree-wide: rename path_join_many() to path_join() 2018-11-30 10:59:47 +01:00
test-json.c Add fmemopen_unlocked() and use unlocked ops in fuzzers and some other tests 2019-04-12 11:44:57 +02:00
test-libmount.c test-libmount: let's see how libmount parses stuff 2019-04-09 09:07:40 +02:00
test-libudev.c test-libudev: modernize and add more debugging info 2019-01-21 17:33:53 +01:00
test-list.c tree-wide: beautify remaining copyright statements 2018-06-14 10:20:21 +02:00
test-locale-util.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-log.c test: add tests for log_syntax() 2019-03-04 15:28:32 +09:00
test-loopback.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-mount-util.c Split out part of mount-util.c into mountpoint-util.c 2018-11-29 21:03:44 +01:00
test-mountpoint-util.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-namespace.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-netlink-manual.c tree-wide: drop several missing_*.h and import relevant headers from kernel-5.0 2019-04-11 19:00:37 +02:00
test-ns.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-nscd-flush.c shared: add helper for flushing nscd caches 2018-12-15 12:10:19 +01:00
test-nss.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-ordered-set.c basic/ordered-set: export networkd function to print string sets 2019-02-21 12:00:05 +01:00
test-os-util.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-parse-util.c parse-util: rework parse_dev() based on safe_atou() and DEVICE_MAJOR_VALID()/DEVICE_MINOR_VALID() 2018-11-29 20:02:39 +01:00
test-path-lookup.c Merge pull request #10070 from keszybz/test-reporting 2018-09-15 15:55:15 +09:00
test-path-util.c tree-wide: constify a few static string tables 2019-03-25 14:04:34 +01:00
test-path.c tree-wide: rename path_join_many() to path_join() 2018-11-30 10:59:47 +01:00
test-pretty-print.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-prioq.c util: split out sorting related calls to new sort-util.[ch] 2019-03-13 12:16:43 +01:00
test-proc-cmdline.c tests: add tests for embedded newlines in /proc/cmdline 2019-03-13 17:07:02 +01:00
test-process-util.c util: introduce save_argc_argv() helper 2019-03-21 18:08:56 +01:00
test-procfs-util.c procfs-util: expose functionality to query total memory 2019-01-22 17:43:13 +01:00
test-random-util.c random-util: allow RDRAND to be used in 32-bit x86 binaries 2018-11-10 14:56:53 +01:00
test-ratelimit.c tree-wide: drop copyright headers from frequent contributors 2018-06-20 11:58:53 +02:00
test-replace-var.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-rlimit-util.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-sched-prio.c tests: add a helper function to skip with errno 2018-09-14 09:29:57 +02:00
test-sd-hwdb.c test: initialize hwdb so that the test won't try to free memory it has never allocated 2018-11-08 13:49:45 +01:00
test-seccomp.c test-seccomp: fix compilation on arm64 2019-04-03 13:24:43 +02:00
test-selinux.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-serialize.c util-lib: split out all temporary file related calls into tmpfiles-util.c 2018-12-02 13:22:29 +01:00
test-set-disable-mempool.c test: add tests for $SYSTEMD_MEMPOOL= 2018-10-12 17:54:23 +09:00
test-set.c basic/ordered-set: add functions to operate on OrderedSets of strings 2019-02-21 12:00:05 +01:00
test-sigbus.c util: split out memcmp()/memset() related calls into memory-util.[ch] 2019-03-13 12:16:43 +01:00
test-signal-util.c tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
test-siphash24.c util: split out memcmp()/memset() related calls into memory-util.[ch] 2019-03-13 12:16:43 +01:00
test-sizeof.c test-sizeof: print the alignments too 2019-02-05 18:56:41 +01:00
test-sleep.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-socket-util.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-specifier.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-stat-util.c util: split out namespace related stuff into a new namespace-util.[ch] pair 2019-03-13 12:16:38 +01:00
test-static-destruct.c test: add test for static destructor 2018-12-03 17:34:23 +01:00
test-strbuf.c tree-wide: drop copyright headers from frequent contributors 2018-06-20 11:58:53 +02:00
test-string-util.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-strip-tab-ansi.c Split out pretty-print.c and move pager.c and main-func.h to shared/ 2018-11-20 18:40:02 +01:00
test-strv.c util: split out nulstr related stuff to nulstr-util.[ch] 2019-03-14 13:25:52 +01:00
test-strxcpyx.c tree-wide: drop copyright headers from frequent contributors 2018-06-20 11:58:53 +02:00
test-systemd-tmpfiles.py tree-wide: drop header for emacs from python scripts 2018-12-10 03:17:33 +09:00
test-tables.c udev/link-config: rename MACPolicy to MACAddressPolicy 2019-03-22 17:16:17 +01:00
test-terminal-util.c test-terminal-util: fix sigsegv when compiled without asserts 2019-03-28 09:45:19 +01:00
test-time-util.c test-time-util: use standard intro and print timezones read from file 2019-02-28 15:38:52 +01:00
test-tmpfiles.c util-lib: split out all temporary file related calls into tmpfiles-util.c 2018-12-02 13:22:29 +01:00
test-udev.c meson: generate version tag from git 2018-12-21 13:43:20 +01:00
test-uid-range.c tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
test-umount.c tree-wide: rename path_join_many() to path_join() 2018-11-30 10:59:47 +01:00
test-unaligned.c util: split out memcmp()/memset() related calls into memory-util.[ch] 2019-03-13 12:16:43 +01:00
test-unit-file.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-unit-name.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-user-util.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-utf8.c basic/utf8: do not read past end of string when looking for a multi-byte character 2019-02-26 12:37:40 +01:00
test-util.c util: don't include util.h from def.h 2019-03-14 13:25:51 +01:00
test-verbs.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-watch-pid.c core: reduce the number of stalled PIDs from the watched processes list when possible 2019-03-20 10:51:49 +01:00
test-watchdog.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-web-util.c tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
test-xattr-util.c util-lib: split out all temporary file related calls into tmpfiles-util.c 2018-12-02 13:22:29 +01:00
test-xml.c tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00