Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1318415

Re: [PATCH] mm: memcontrol: drop superfluous entry in the per-memcg stats array

From Andrew Morton <akpm@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH] mm: memcontrol: drop superfluous entry in the per-memcg stats array
Date 2016-01-26 22:40 +0100
Message-ID <qVjvc-1Q5-23@gated-at.bofh.it> (permalink)
References <qViSv-1iC-37@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 26 Jan 2016 15:55:29 -0500 Johannes Weiner <hannes@cmpxchg.org> wrote:

> MEM_CGROUP_STAT_NSTATS is just a delimiter for cgroup1 statistics, not
> an actual array entry. Reuse it for the first cgroup2 stat entry, like
> in the event array.
> 
> ...
>
> --- a/include/linux/memcontrol.h
> +++ b/include/linux/memcontrol.h
> @@ -51,7 +51,7 @@ enum mem_cgroup_stat_index {
>  	MEM_CGROUP_STAT_SWAP,		/* # of pages, swapped out */
>  	MEM_CGROUP_STAT_NSTATS,
>  	/* default hierarchy stats */
> -	MEMCG_SOCK,
> +	MEMCG_SOCK = MEM_CGROUP_STAT_NSTATS,
>  	MEMCG_NR_STAT,
>  };

The code looks a bit odd.  How come mem_cgroup_stat_names[] ends with
"swap"?  Should MEMCG_SOCK be in there at all?

And the naming is a bit sad.  "MEM_CGROUP_STAT_FILE_MAPPED" maps to
"mapped_file", not "file_mapped".

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] mm: memcontrol: drop superfluous entry in the per-memcg stats array Johannes Weiner <hannes@cmpxchg.org> - 2016-01-26 22:00 +0100
  Re: [PATCH] mm: memcontrol: drop superfluous entry in the per-memcg  stats array Andrew Morton <akpm@linux-foundation.org> - 2016-01-26 22:40 +0100
    Re: [PATCH] mm: memcontrol: drop superfluous entry in the per-memcg  stats array Johannes Weiner <hannes@cmpxchg.org> - 2016-01-26 22:50 +0100

csiph-web