diff options
author | Tejun Heo <tj@kernel.org> | 2018-06-09 02:33:14 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-07-12 08:21:43 +0200 |
commit | 484226357789991de0b3363beb69258be06b4c92 (patch) | |
tree | 346b883c553860ce6d4b7b87f14a0493957760ba /src/systemctl/systemctl.c | |
parent | hwdb: remove stray 'i' in hwdb match string for the HP Spectre (#9571) (diff) | |
download | systemd-484226357789991de0b3363beb69258be06b4c92.tar.xz systemd-484226357789991de0b3363beb69258be06b4c92.zip |
core: add MemoryMin
The kernel added support for a new cgroup memory controller knob memory.min in
bf8d5d52ffe8 ("memcg: introduce memory.min") which was merged during v4.18
merge window.
Add MemoryMin to support memory.min.
Diffstat (limited to '')
-rw-r--r-- | src/systemctl/systemctl.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 9c6156237a..8f337b78a2 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -3911,6 +3911,7 @@ typedef struct UnitStatusInfo { /* CGroup */ uint64_t memory_current; + uint64_t memory_min; uint64_t memory_low; uint64_t memory_high; uint64_t memory_max; @@ -4290,12 +4291,17 @@ static void print_status_info( printf(" Memory: %s", format_bytes(buf, sizeof(buf), i->memory_current)); - if (i->memory_low > 0 || i->memory_high != CGROUP_LIMIT_MAX || - i->memory_max != CGROUP_LIMIT_MAX || i->memory_swap_max != CGROUP_LIMIT_MAX || + if (i->memory_min > 0 || i->memory_low > 0 || + i->memory_high != CGROUP_LIMIT_MAX || i->memory_max != CGROUP_LIMIT_MAX || + i->memory_swap_max != CGROUP_LIMIT_MAX || i->memory_limit != CGROUP_LIMIT_MAX) { const char *prefix = ""; printf(" ("); + if (i->memory_min > 0) { + printf("%smin: %s", prefix, format_bytes(buf, sizeof(buf), i->memory_min)); + prefix = " "; + } if (i->memory_low > 0) { printf("%slow: %s", prefix, format_bytes(buf, sizeof(buf), i->memory_low)); prefix = " "; @@ -4971,6 +4977,7 @@ static int show_one( { "Where", "s", NULL, offsetof(UnitStatusInfo, where) }, { "What", "s", NULL, offsetof(UnitStatusInfo, what) }, { "MemoryCurrent", "t", NULL, offsetof(UnitStatusInfo, memory_current) }, + { "MemoryMin", "t", NULL, offsetof(UnitStatusInfo, memory_min) }, { "MemoryLow", "t", NULL, offsetof(UnitStatusInfo, memory_low) }, { "MemoryHigh", "t", NULL, offsetof(UnitStatusInfo, memory_high) }, { "MemoryMax", "t", NULL, offsetof(UnitStatusInfo, memory_max) }, |