Created
April 6, 2016 07:55
-
-
Save rhenium/af15922028489c961e496a397074798f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/mm/memcontrol.c b/mm/memcontrol.c | |
index 36db05f..be54063 100644 | |
--- a/mm/memcontrol.c | |
+++ b/mm/memcontrol.c | |
@@ -4942,6 +4942,14 @@ static u64 memory_current_read(struct cgroup_subsys_state *css, | |
return (u64)page_counter_read(&memcg->memory) * PAGE_SIZE; | |
} | |
+static u64 memory_max_usage_read(struct cgroup_subsys_state *css, | |
+ struct cftype *cft) | |
+{ | |
+ struct mem_cgroup *memcg = mem_cgroup_from_css(css); | |
+ | |
+ return (u64)memcg->memory.watermark * PAGE_SIZE; | |
+} | |
+ | |
static int memory_low_show(struct seq_file *m, void *v) | |
{ | |
struct mem_cgroup *memcg = mem_cgroup_from_css(seq_css(m)); | |
@@ -5155,6 +5163,11 @@ static struct cftype memory_files[] = { | |
.read_u64 = memory_current_read, | |
}, | |
{ | |
+ .name = "max_usage", | |
+ .flags = CFTYPE_NOT_ON_ROOT, | |
+ .read_u64 = memory_max_usage_read, | |
+ }, | |
+ { | |
.name = "low", | |
.flags = CFTYPE_NOT_ON_ROOT, | |
.seq_show = memory_low_show, | |
@@ -5877,6 +5890,14 @@ static u64 swap_current_read(struct cgroup_subsys_state *css, | |
return (u64)page_counter_read(&memcg->swap) * PAGE_SIZE; | |
} | |
+static u64 swap_max_usage_read(struct cgroup_subsys_state *css, | |
+ struct cftype *cft) | |
+{ | |
+ struct mem_cgroup *memcg = mem_cgroup_from_css(css); | |
+ | |
+ return (u64)memcg->swap.watermark * PAGE_SIZE; | |
+} | |
+ | |
static int swap_max_show(struct seq_file *m, void *v) | |
{ | |
struct mem_cgroup *memcg = mem_cgroup_from_css(seq_css(m)); | |
@@ -5918,6 +5939,11 @@ static struct cftype swap_files[] = { | |
.read_u64 = swap_current_read, | |
}, | |
{ | |
+ .name = "swap.max_usage", | |
+ .flags = CFTYPE_NOT_ON_ROOT, | |
+ .read_u64 = swap_max_usage_read, | |
+ }, | |
+ { | |
.name = "swap.max", | |
.flags = CFTYPE_NOT_ON_ROOT, | |
.seq_show = swap_max_show, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment