From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755510AbbJUSuN (ORCPT ); Wed, 21 Oct 2015 14:50:13 -0400 Received: from gum.cmpxchg.org ([85.214.110.215]:39114 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753232AbbJUSuK (ORCPT ); Wed, 21 Oct 2015 14:50:10 -0400 From: Johannes Weiner To: Andrew Morton Cc: linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Michal Hocko , Tejun Heo Subject: [PATCH] mm: memcontrol: eliminate root memory.current Date: Wed, 21 Oct 2015 14:49:54 -0400 Message-Id: <1445453394-15156-1-git-send-email-hannes@cmpxchg.org> X-Mailer: git-send-email 2.6.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- mm/memcontrol.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Tejun, we should probably do this with the other controllers too. I don't think it makes sense anywhere to shoddily duplicate the system statistics on the controller root levels. diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 4f04510..c71fe40 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -5022,7 +5022,7 @@ 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); + return page_counter_read(&mem_cgroup_from_css(css)->memory); } static int memory_low_show(struct seq_file *m, void *v) @@ -5134,6 +5134,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, }, { -- 2.6.1