diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-11-05 13:50:28 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-11-14 18:41:54 +0100 |
commit | 3a0f06c41a29b760fe6c3da7529cf595e583aa06 (patch) | |
tree | b17256725338fb223a5a3c4bd15b8d5312a61ec7 /src/core/dbus-cgroup.h | |
parent | a650e19820b85e7b82a87508a7f80ce764f2f1a0 (diff) | |
download | systemd-3a0f06c41a29b760fe6c3da7529cf595e583aa06.tar.gz |
core: make TasksMax a partially dynamic property
TasksMax= and DefaultTasksMax= can be specified as percentages. We don't
actually document of what the percentage is relative to, but the implementation
uses the smallest of /proc/sys/kernel/pid_max, /proc/sys/kernel/threads-max,
and /sys/fs/cgroup/pids.max (when present). When the value is a percentage,
we immediately convert it to an absolute value. If the limit later changes
(which can happen e.g. when systemd-sysctl runs), the absolute value becomes
outdated.
So let's store either the percentage or absolute value, whatever was specified,
and only convert to an absolute value when the value is used. For example, when
starting a unit, the absolute value will be calculated when the cgroup for
the unit is created.
Fixes #13419.
Diffstat (limited to 'src/core/dbus-cgroup.h')
-rw-r--r-- | src/core/dbus-cgroup.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/dbus-cgroup.h b/src/core/dbus-cgroup.h index 188baa99e9..5ca68a63bf 100644 --- a/src/core/dbus-cgroup.h +++ b/src/core/dbus-cgroup.h @@ -9,4 +9,6 @@ extern const sd_bus_vtable bus_cgroup_vtable[]; +int bus_property_get_tasks_max(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *ret_error); + int bus_cgroup_set_property(Unit *u, CGroupContext *c, const char *name, sd_bus_message *message, UnitWriteFlags flags, sd_bus_error *error); |