diff options
author | Tejun Heo <htejun@fb.com> | 2016-08-18 22:57:53 -0400 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-07-05 08:50:52 +0200 |
commit | e271d1f29638c009e455a6e06e0865e01cf26f86 (patch) | |
tree | 532e14fd8c06fa3b2fac9404e57099fb6f14dc68 /src/basic/cgroup-util.h | |
parent | 0801458c689ba85fd27666f69e42818f87353bc2 (diff) |
logind: update empty and "infinity" handling for [User]TasksMax (#3835)
The parsing functions for [User]TasksMax were inconsistent. Empty string and
"infinity" were interpreted as no limit for TasksMax but not accepted for
UserTasksMax. Update them so that they're consistent with other knobs.
* Empty string indicates the default value.
* "infinity" indicates no limit.
While at it, replace opencoded (uint64_t) -1 with CGROUP_LIMIT_MAX in TasksMax
handling.
v2: Update empty string to indicate the default value as suggested by Zbigniew
Jędrzejewski-Szmek.
v3: Fixed empty UserTasksMax handling.
Diffstat (limited to 'src/basic/cgroup-util.h')
-rw-r--r-- | src/basic/cgroup-util.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/basic/cgroup-util.h b/src/basic/cgroup-util.h index 0255e2850..5f3152995 100644 --- a/src/basic/cgroup-util.h +++ b/src/basic/cgroup-util.h @@ -114,6 +114,10 @@ static inline bool CGROUP_BLKIO_WEIGHT_IS_OK(uint64_t x) { } #endif // 0 +/* Default resource limits */ +#define DEFAULT_TASKS_MAX_PERCENTAGE 15U /* 15% of PIDs, 4915 on default settings */ +#define DEFAULT_USER_TASKS_MAX_PERCENTAGE 33U /* 33% of PIDs, 10813 on default settings */ + /* * General rules: * @@ -238,7 +242,7 @@ bool cg_ns_supported(void); #endif // 0 #if 0 /// UNNEEDED by elogind -int cg_all_unified(void); +int cg_unified(void); void cg_unified_flush(void); bool cg_is_unified_wanted(void); |