From: Roman Gushchin <guro@fb.com>
To: Chris Down <chris@chrisdown.name>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>, Tejun Heo <tj@kernel.org>,
Dennis Zhou <dennis@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"cgroups@vger.kernel.org" <cgroups@vger.kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Kernel Team <Kernel-team@fb.com>
Subject: Re: [PATCH 1/2] mm: Rename ambiguously named memory.stat counters and functions
Date: Wed, 23 Jan 2019 23:59:47 +0000 [thread overview]
Message-ID: <20190123235940.GA21563@castle.DHCP.thefacebook.com> (raw)
In-Reply-To: <20190123223049.GA9149@chrisdown.name>
On Wed, Jan 23, 2019 at 05:30:49PM -0500, Chris Down wrote:
> I spent literally an hour trying to work out why an earlier version of
> my memory.events aggregation code doesn't work properly, only to find
> out I was calling memcg->events instead of memcg->memory_events, which
> is fairly confusing.
>
> This naming seems in need of reworking, so make it harder to do the
> wrong thing by using vmevents instead of events, which makes it more
> clear that these are vm counters rather than memcg-specific counters.
>
> There are also a few other inconsistent names in both the percpu and
> aggregated structs, so these are all cleaned up to be more coherent and
> easy to understand.
>
> This commit contains code cleanup only: there are no logic changes.
>
> Signed-off-by: Chris Down <chris@chrisdown.name>
> Acked-by: Johannes Weiner <hannes@cmpxchg.org>
> To: Andrew Morton <akpm@linux-foundation.org>
s/To/Cc
> Cc: Michal Hocko <mhocko@kernel.org>
> Cc: Tejun Heo <tj@kernel.org>
> Cc: Roman Gushchin <guro@fb.com>
> Cc: Dennis Zhou <dennis@kernel.org>
> Cc: linux-kernel@vger.kernel.org
> Cc: cgroups@vger.kernel.org
> Cc: linux-mm@kvack.org
> Cc: kernel-team@fb.com
> ---
> include/linux/memcontrol.h | 24 +++----
> mm/memcontrol.c | 137 +++++++++++++++++++------------------
> 2 files changed, 82 insertions(+), 79 deletions(-)
>
> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
> index b0eb29ea0d9c..380a212a8c52 100644
> --- a/include/linux/memcontrol.h
> +++ b/include/linux/memcontrol.h
> @@ -94,8 +94,8 @@ enum mem_cgroup_events_target {
> MEM_CGROUP_NTARGETS,
> };
>
> -struct mem_cgroup_stat_cpu {
> - long count[MEMCG_NR_STAT];
> +struct memcg_vmstats_percpu {
> + long stat[MEMCG_NR_STAT];
I'd personally go with memcg_vmstat_percpu. Not insisting,
but you end up using both vmstat and vmstats, which isn't very
consistent.
Other than that looks good to me. Please, feel free to add
Acked-by: Roman Gushchin <guro@fb.com>
Thanks!
next prev parent reply other threads:[~2019-01-24 0:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-23 22:30 Chris Down
2019-01-23 23:59 ` Roman Gushchin [this message]
2019-01-24 1:06 ` Chris Down
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=20190123235940.GA21563@castle.DHCP.thefacebook.com \
--to=guro@fb.com \
--cc=Kernel-team@fb.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=chris@chrisdown.name \
--cc=dennis@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=tj@kernel.org \
/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