From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752366AbcBEKCJ (ORCPT ); Fri, 5 Feb 2016 05:02:09 -0500 Received: from mx2.parallels.com ([199.115.105.18]:48674 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751042AbcBEKCG (ORCPT ); Fri, 5 Feb 2016 05:02:06 -0500 Date: Fri, 5 Feb 2016 13:01:57 +0300 From: Vladimir Davydov To: Johannes Weiner CC: Andrew Morton , Michal Hocko , , Subject: Re: [PATCH 3/3] mm: memcontrol: report kernel stack usage in cgroup2 memory.stat Message-ID: <20160205100157.GB29522@esperanza> References: <57ff0330b597738127ae0f9ca331016719bea7d8.1454589800.git.vdavydov@virtuozzo.com> <1d7473a8f8b814e536f9fdbd29d90591f1952f73.1454589800.git.vdavydov@virtuozzo.com> <20160204205210.GF8208@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20160204205210.GF8208@cmpxchg.org> X-ClientProxiedBy: US-EXCH2.sw.swsoft.com (10.255.249.46) To US-EXCH.sw.swsoft.com (10.255.249.47) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 04, 2016 at 03:52:10PM -0500, Johannes Weiner wrote: > On Thu, Feb 04, 2016 at 04:03:39PM +0300, Vladimir Davydov wrote: > > Show how much memory is allocated to kernel stacks. > > > > Signed-off-by: Vladimir Davydov > > Acked-by: Johannes Weiner Thanks. > > Thanks, this looks good. The only thing that strikes me is that you > appended the new stat items to the enum, but then prepended them to > the doc and stat file sections. Why is that? No reason. Let's rearrange the enum fields to be consistent with the stat file output. diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index aaf564881303..d6300313b298 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -52,10 +52,10 @@ enum mem_cgroup_stat_index { MEM_CGROUP_STAT_SWAP, /* # of pages, swapped out */ MEM_CGROUP_STAT_NSTATS, /* default hierarchy stats */ - MEMCG_SOCK = MEM_CGROUP_STAT_NSTATS, + MEMCG_KERNEL_STACK = MEM_CGROUP_STAT_NSTATS, MEMCG_SLAB_RECLAIMABLE, MEMCG_SLAB_UNRECLAIMABLE, - MEMCG_KERNEL_STACK, + MEMCG_SOCK, MEMCG_NR_STAT, };