summaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
authorJohannes Weiner2015-11-06 03:50:23 +0100
committerLinus Torvalds2015-11-06 04:34:48 +0100
commitf5fc3c5d817435970aa301d066820a9ac12c8120 (patch)
tree7b0d1d981ca5308c47eef73050e7f81feca43f0e /mm/memcontrol.c
parentmm, hugetlbfs: optimize when NUMA=n (diff)
downloadkernel-qcow2-linux-f5fc3c5d817435970aa301d066820a9ac12c8120.tar.gz
kernel-qcow2-linux-f5fc3c5d817435970aa301d066820a9ac12c8120.tar.xz
kernel-qcow2-linux-f5fc3c5d817435970aa301d066820a9ac12c8120.zip
mm: memcontrol: eliminate root memory.current
memory.current on the root level doesn't add anything that wouldn't be more accurate and detailed using system statistics. It already doesn't include slabs, and it'll be a pain to keep in sync when further memory types are accounted in the memory controller. Remove it. Note that this applies to the new unified hierarchy interface only. Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index a44494f3a965..59b100fde35f 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5026,7 +5026,9 @@ static void mem_cgroup_bind(struct cgroup_subsys_state *root_css)
static u64 memory_current_read(struct cgroup_subsys_state *css,
struct cftype *cft)
{
- return mem_cgroup_usage(mem_cgroup_from_css(css), false);
+ struct mem_cgroup *memcg = mem_cgroup_from_css(css);
+
+ return (u64)page_counter_read(&memcg->memory) * PAGE_SIZE;
}
static int memory_low_show(struct seq_file *m, void *v)
@@ -5138,6 +5140,7 @@ static int memory_events_show(struct seq_file *m, void *v)
static struct cftype memory_files[] = {
{
.name = "current",
+ .flags = CFTYPE_NOT_ON_ROOT,
.read_u64 = memory_current_read,
},
{