summaryrefslogtreecommitdiff
path: root/src/core/cgroup.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-10 12:32:16 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-10 18:41:06 +0200
commit03a7b521e3ffb7f5d153d90480ba5d4bc29d1e8f (patch)
treed18052ac68aae77bcce3813e64bf1f956cc9ad7d /src/core/cgroup.h
parent15af581253a3f25a71d4fa723bf1fdd22f842728 (diff)
core: add support for the "pids" cgroup controller
This adds support for the new "pids" cgroup controller of 4.3 kernels. It allows accounting the number of tasks in a cgroup and enforcing limits on it. This adds two new setting TasksAccounting= and TasksMax= to each unit, as well as a gloabl option DefaultTasksAccounting=. This also updated "cgtop" to optionally make use of the new kernel-provided accounting. systemctl has been updated to show the number of tasks for each service if it is available. This patch also adds correct support for undoing memory limits for units using a MemoryLimit=infinity syntax. We do the same for TasksMax= now and hence keep things in sync here.
Diffstat (limited to 'src/core/cgroup.h')
-rw-r--r--src/core/cgroup.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/cgroup.h b/src/core/cgroup.h
index 438f5bf50f..3ba09d56a4 100644
--- a/src/core/cgroup.h
+++ b/src/core/cgroup.h
@@ -72,6 +72,7 @@ struct CGroupContext {
bool cpu_accounting;
bool blockio_accounting;
bool memory_accounting;
+ bool tasks_accounting;
unsigned long cpu_shares;
unsigned long startup_cpu_shares;
@@ -88,6 +89,8 @@ struct CGroupContext {
LIST_HEAD(CGroupDeviceAllow, device_allow);
bool delegate;
+
+ uint64_t tasks_max;
};
#include "unit.h"
@@ -137,6 +140,7 @@ int unit_search_main_pid(Unit *u, pid_t *ret);
int unit_watch_all_pids(Unit *u);
int unit_get_memory_current(Unit *u, uint64_t *ret);
+int unit_get_tasks_current(Unit *u, uint64_t *ret);
int unit_get_cpu_usage(Unit *u, nsec_t *ret);
int unit_reset_cpu_usage(Unit *u);