mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-02-03 13:47:04 +03:00
core: always use "infinity" for no upper limit instead of "max" (#3417)
Recently added cgroup unified hierarchy support uses "max" in configurations for no upper limit. While consistent with what the kernel uses for no upper limit, it is inconsistent with what systemd uses for other controllers such as memory or pids. There's no point in introducing another term. Update cgroup unified hierarchy support so that "infinity" is the only term that systemd uses for no upper limit.
This commit is contained in:
parent
ac9b215d0c
commit
e57c9ce169
@ -248,7 +248,7 @@
|
||||
|
||||
<para>Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is
|
||||
parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. If assigned the
|
||||
special value <literal>max</literal>, no memory limit is applied. This controls the
|
||||
special value <literal>infinity</literal>, no memory limit is applied. This controls the
|
||||
<literal>memory.high</literal> control group attribute. For details about this control group attribute, see
|
||||
<ulink url="https://www.kernel.org/doc/Documentation/cgroup-v2.txt">cgroup-v2.txt</ulink>.</para>
|
||||
|
||||
@ -269,7 +269,7 @@
|
||||
|
||||
<para>Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is
|
||||
parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. If assigned the
|
||||
special value <literal>max</literal>, no memory limit is applied. This controls the
|
||||
special value <literal>infinity</literal>, no memory limit is applied. This controls the
|
||||
<literal>memory.max</literal> control group attribute. For details about this control group attribute, see
|
||||
<ulink url="https://www.kernel.org/doc/Documentation/cgroup-v2.txt">cgroup-v2.txt</ulink>.</para>
|
||||
|
||||
|
@ -2811,7 +2811,7 @@ int config_parse_memory_limit(
|
||||
uint64_t bytes = CGROUP_LIMIT_MAX;
|
||||
int r;
|
||||
|
||||
if (!isempty(rvalue) && !streq(rvalue, "infinity") && !streq(rvalue, "max")) {
|
||||
if (!isempty(rvalue) && !streq(rvalue, "infinity")) {
|
||||
r = parse_size(rvalue, 1024, &bytes);
|
||||
if (r < 0 || bytes < 1) {
|
||||
log_syntax(unit, LOG_ERR, filename, line, r, "Memory limit '%s' invalid. Ignoring.", rvalue);
|
||||
@ -3080,7 +3080,7 @@ int config_parse_io_limit(
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (streq("max", limit)) {
|
||||
if (streq("infinity", limit)) {
|
||||
num = CGROUP_LIMIT_MAX;
|
||||
} else {
|
||||
r = parse_size(limit, 1000, &num);
|
||||
|
@ -169,7 +169,7 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
|
||||
} else if (STR_IN_SET(field, "MemoryLow", "MemoryHigh", "MemoryMax", "MemoryLimit")) {
|
||||
uint64_t bytes;
|
||||
|
||||
if (isempty(eq) || streq(eq, "max") || streq(eq, "infinity"))
|
||||
if (isempty(eq) || streq(eq, "infinity"))
|
||||
bytes = CGROUP_LIMIT_MAX;
|
||||
else {
|
||||
r = parse_size(eq, 1024, &bytes);
|
||||
@ -306,7 +306,7 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (streq(bandwidth, "max")) {
|
||||
if (streq(bandwidth, "infinity")) {
|
||||
bytes = CGROUP_LIMIT_MAX;
|
||||
} else {
|
||||
r = parse_size(bandwidth, 1000, &bytes);
|
||||
|
Loading…
x
Reference in New Issue
Block a user