* [PATCH] mm: memcontrol: drop superfluous entry in the per-memcg stats array
@ 2016-01-26 20:55 ` Johannes Weiner
0 siblings, 0 replies; 9+ messages in thread
From: Johannes Weiner @ 2016-01-26 20:55 UTC (permalink / raw)
To: Andrew Morton
Cc: Vladimir Davydov, Michal Hocko, linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
cgroups-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, kernel-team-b10kYP2dOMg
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.
Fixes: b2807f07f4f8 ("mm: memcontrol: add "sock" to cgroup2 memory.stat")
Signed-off-by: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
---
include/linux/memcontrol.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 9ae48d4aeb5e..792c8981e633 100644
--- 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,
};
--
2.7.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH] mm: memcontrol: drop superfluous entry in the per-memcg stats array
@ 2016-01-26 20:55 ` Johannes Weiner
0 siblings, 0 replies; 9+ messages in thread
From: Johannes Weiner @ 2016-01-26 20:55 UTC (permalink / raw)
To: Andrew Morton
Cc: Vladimir Davydov, Michal Hocko, linux-mm, cgroups, linux-kernel,
kernel-team
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.
Fixes: b2807f07f4f8 ("mm: memcontrol: add "sock" to cgroup2 memory.stat")
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
---
include/linux/memcontrol.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 9ae48d4aeb5e..792c8981e633 100644
--- 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,
};
--
2.7.0
--
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>
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH] mm: memcontrol: drop superfluous entry in the per-memcg stats array
@ 2016-01-26 20:55 ` Johannes Weiner
0 siblings, 0 replies; 9+ messages in thread
From: Johannes Weiner @ 2016-01-26 20:55 UTC (permalink / raw)
To: Andrew Morton
Cc: Vladimir Davydov, Michal Hocko, linux-mm, cgroups, linux-kernel,
kernel-team
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.
Fixes: b2807f07f4f8 ("mm: memcontrol: add "sock" to cgroup2 memory.stat")
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
---
include/linux/memcontrol.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 9ae48d4aeb5e..792c8981e633 100644
--- 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,
};
--
2.7.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] mm: memcontrol: drop superfluous entry in the per-memcg stats array
2016-01-26 20:55 ` Johannes Weiner
(?)
@ 2016-01-26 21:30 ` Andrew Morton
-1 siblings, 0 replies; 9+ messages in thread
From: Andrew Morton @ 2016-01-26 21:30 UTC (permalink / raw)
To: Johannes Weiner
Cc: Vladimir Davydov, Michal Hocko, linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
cgroups-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, kernel-team-b10kYP2dOMg
On Tue, 26 Jan 2016 15:55:29 -0500 Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.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".
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] mm: memcontrol: drop superfluous entry in the per-memcg stats array
@ 2016-01-26 21:30 ` Andrew Morton
0 siblings, 0 replies; 9+ messages in thread
From: Andrew Morton @ 2016-01-26 21:30 UTC (permalink / raw)
To: Johannes Weiner
Cc: Vladimir Davydov, Michal Hocko, linux-mm, cgroups, linux-kernel,
kernel-team
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".
--
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>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] mm: memcontrol: drop superfluous entry in the per-memcg stats array
@ 2016-01-26 21:30 ` Andrew Morton
0 siblings, 0 replies; 9+ messages in thread
From: Andrew Morton @ 2016-01-26 21:30 UTC (permalink / raw)
To: Johannes Weiner
Cc: Vladimir Davydov, Michal Hocko, linux-mm, cgroups, linux-kernel,
kernel-team
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".
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] mm: memcontrol: drop superfluous entry in the per-memcg stats array
2016-01-26 21:30 ` Andrew Morton
(?)
@ 2016-01-26 21:43 ` Johannes Weiner
-1 siblings, 0 replies; 9+ messages in thread
From: Johannes Weiner @ 2016-01-26 21:43 UTC (permalink / raw)
To: Andrew Morton
Cc: Vladimir Davydov, Michal Hocko, linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
cgroups-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, kernel-team-b10kYP2dOMg
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-druUgvl0LCNAfugRpC6u6w@public.gmane.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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] mm: memcontrol: drop superfluous entry in the per-memcg stats array
@ 2016-01-26 21:43 ` Johannes Weiner
0 siblings, 0 replies; 9+ messages in thread
From: Johannes Weiner @ 2016-01-26 21:43 UTC (permalink / raw)
To: Andrew Morton
Cc: Vladimir Davydov, Michal Hocko, linux-mm, cgroups, linux-kernel,
kernel-team
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>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] mm: memcontrol: drop superfluous entry in the per-memcg stats array
@ 2016-01-26 21:43 ` Johannes Weiner
0 siblings, 0 replies; 9+ messages in thread
From: Johannes Weiner @ 2016-01-26 21:43 UTC (permalink / raw)
To: Andrew Morton
Cc: Vladimir Davydov, Michal Hocko, linux-mm, cgroups, linux-kernel,
kernel-team
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.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-01-26 21:44 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-26 20:55 [PATCH] mm: memcontrol: drop superfluous entry in the per-memcg stats array Johannes Weiner
2016-01-26 20:55 ` Johannes Weiner
2016-01-26 20:55 ` Johannes Weiner
[not found] ` <1453841729-29072-1-git-send-email-hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2016-01-26 21:30 ` Andrew Morton
2016-01-26 21:30 ` Andrew Morton
2016-01-26 21:30 ` Andrew Morton
[not found] ` <20160126133024.07f372dbf8935e03a3035269-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2016-01-26 21:43 ` Johannes Weiner
2016-01-26 21:43 ` Johannes Weiner
2016-01-26 21:43 ` Johannes Weiner
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.