lkml.org 
[lkml]   [2016]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm: memcontrol: drop superfluous entry in the per-memcg stats array
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".

\
 
 \ /
  Last update: 2016-01-26 22:41    [W:0.031 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site