linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@cmpxchg.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Vladimir Davydov <vdavydov@virtuozzo.com>,
	Michal Hocko <mhocko@suse.cz>,
	linux-mm@kvack.org, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH] mm: memcontrol: drop superfluous entry in the per-memcg stats array
Date: Tue, 26 Jan 2016 16:43:34 -0500	[thread overview]
Message-ID: <20160126214334.GA4016@cmpxchg.org> (raw)
In-Reply-To: <20160126133024.07f372dbf8935e03a3035269@linux-foundation.org>

On Tue, Jan 26, 2016 at 01:30:24PM -0800, Andrew Morton wrote:
> 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?

It's cgroup1 vs. cgroup2 statistics. I'm using the same array in order
to use the original statistics infrastructure. It's a little weird, it
will be much cleaner once everything is converted to percpu_counter.

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

MEM_CGROUP_STAT_FILE_MAPPED is named after NR_FILE_MAPPED because
they're both accounted from the same sites. Who knows why the
user-visible stat was then called mapped_file... :/

And in cgroup2 it's called file_mapped! At least there it'll be
consistent.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2016-01-26 21:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26 20:55 Johannes Weiner
2016-01-26 21:30 ` Andrew Morton
2016-01-26 21:43   ` Johannes Weiner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160126214334.GA4016@cmpxchg.org \
    --to=hannes@cmpxchg.org \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=vdavydov@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox