Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

[patch 6/6] mm: memcg: print statistics from live counters

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


hannes at cmpxchg

May 14, 2012, 11:00 AM

Post #1 of 5 (106 views)
Permalink
[patch 6/6] mm: memcg: print statistics from live counters

Directly print statistics and event counters instead of going through
an intermediate accumulation stage into a separate array, which used
to require defining statistic items in more than one place.

Signed-off-by: Johannes Weiner <hannes [at] cmpxchg>
---
mm/memcontrol.c | 173 +++++++++++++++++++++----------------------------------
1 file changed, 66 insertions(+), 107 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 3ee63f6..b0d343a 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -102,6 +102,14 @@ enum mem_cgroup_stat_index {
MEM_CGROUP_STAT_NSTATS,
};

+static const char *mem_cgroup_stat_names[] = {
+ "cache",
+ "rss",
+ "mapped_file",
+ "mlock",
+ "swap",
+};
+
enum mem_cgroup_events_index {
MEM_CGROUP_EVENTS_PGPGIN, /* # of pages paged in */
MEM_CGROUP_EVENTS_PGPGOUT, /* # of pages paged out */
@@ -109,6 +117,14 @@ enum mem_cgroup_events_index {
MEM_CGROUP_EVENTS_PGMAJFAULT, /* # of major page-faults */
MEM_CGROUP_EVENTS_NSTATS,
};
+
+static const char *mem_cgroup_events_names[] = {
+ "pgpgin",
+ "pgpgout",
+ "pgfault",
+ "pgmajfault",
+};
+
/*
* Per memcg event counter is incremented at every pagein/pageout. With THP,
* it will be incremated by the number of pages. This counter is used for
@@ -4250,97 +4266,6 @@ static int mem_cgroup_move_charge_write(struct cgroup *cgrp,
}
#endif

-
-/* For read statistics */
-enum {
- MCS_CACHE,
- MCS_RSS,
- MCS_FILE_MAPPED,
- MCS_MLOCK,
- MCS_SWAP,
- MCS_PGPGIN,
- MCS_PGPGOUT,
- MCS_PGFAULT,
- MCS_PGMAJFAULT,
- MCS_INACTIVE_ANON,
- MCS_ACTIVE_ANON,
- MCS_INACTIVE_FILE,
- MCS_ACTIVE_FILE,
- MCS_UNEVICTABLE,
- NR_MCS_STAT,
-};
-
-struct mcs_total_stat {
- s64 stat[NR_MCS_STAT];
-};
-
-static const char *memcg_stat_strings[NR_MCS_STAT] = {
- "cache",
- "rss",
- "mapped_file",
- "mlock",
- "swap",
- "pgpgin",
- "pgpgout",
- "pgfault",
- "pgmajfault",
- "inactive_anon",
- "active_anon",
- "inactive_file",
- "active_file",
- "unevictable",
-};
-
-
-static void
-mem_cgroup_get_local_stat(struct mem_cgroup *memcg, struct mcs_total_stat *s)
-{
- s64 val;
-
- /* per cpu stat */
- val = mem_cgroup_read_stat(memcg, MEM_CGROUP_STAT_CACHE);
- s->stat[MCS_CACHE] += val * PAGE_SIZE;
- val = mem_cgroup_read_stat(memcg, MEM_CGROUP_STAT_RSS);
- s->stat[MCS_RSS] += val * PAGE_SIZE;
- val = mem_cgroup_read_stat(memcg, MEM_CGROUP_STAT_FILE_MAPPED);
- s->stat[MCS_FILE_MAPPED] += val * PAGE_SIZE;
- val = mem_cgroup_read_stat(memcg, MEM_CGROUP_STAT_MLOCK);
- s->stat[MCS_MLOCK] += val * PAGE_SIZE;
- if (do_swap_account) {
- val = mem_cgroup_read_stat(memcg, MEM_CGROUP_STAT_SWAPOUT);
- s->stat[MCS_SWAP] += val * PAGE_SIZE;
- }
- val = mem_cgroup_read_events(memcg, MEM_CGROUP_EVENTS_PGPGIN);
- s->stat[MCS_PGPGIN] += val;
- val = mem_cgroup_read_events(memcg, MEM_CGROUP_EVENTS_PGPGOUT);
- s->stat[MCS_PGPGOUT] += val;
- val = mem_cgroup_read_events(memcg, MEM_CGROUP_EVENTS_PGFAULT);
- s->stat[MCS_PGFAULT] += val;
- val = mem_cgroup_read_events(memcg, MEM_CGROUP_EVENTS_PGMAJFAULT);
- s->stat[MCS_PGMAJFAULT] += val;
-
- /* per zone stat */
- val = mem_cgroup_nr_lru_pages(memcg, BIT(LRU_INACTIVE_ANON));
- s->stat[MCS_INACTIVE_ANON] += val * PAGE_SIZE;
- val = mem_cgroup_nr_lru_pages(memcg, BIT(LRU_ACTIVE_ANON));
- s->stat[MCS_ACTIVE_ANON] += val * PAGE_SIZE;
- val = mem_cgroup_nr_lru_pages(memcg, BIT(LRU_INACTIVE_FILE));
- s->stat[MCS_INACTIVE_FILE] += val * PAGE_SIZE;
- val = mem_cgroup_nr_lru_pages(memcg, BIT(LRU_ACTIVE_FILE));
- s->stat[MCS_ACTIVE_FILE] += val * PAGE_SIZE;
- val = mem_cgroup_nr_lru_pages(memcg, BIT(LRU_UNEVICTABLE));
- s->stat[MCS_UNEVICTABLE] += val * PAGE_SIZE;
-}
-
-static void
-mem_cgroup_get_total_stat(struct mem_cgroup *memcg, struct mcs_total_stat *s)
-{
- struct mem_cgroup *iter;
-
- for_each_mem_cgroup_tree(iter, memcg)
- mem_cgroup_get_local_stat(iter, s);
-}
-
#ifdef CONFIG_NUMA
static int mem_control_numa_stat_show(struct cgroup *cont, struct cftype *cft,
struct seq_file *m)
@@ -4388,24 +4313,40 @@ static int mem_control_numa_stat_show(struct cgroup *cont, struct cftype *cft,
}
#endif /* CONFIG_NUMA */

+static const char *mem_cgroup_lru_names[] = {
+ "inactive_anon",
+ "active_anon",
+ "inactive_file",
+ "active_file",
+ "unevictable",
+};
+static inline void mem_cgroup_lru_names_not_uptodate(void)
+{
+ BUILD_BUG_ON(ARRAY_SIZE(mem_cgroup_lru_names) != NR_LRU_LISTS);
+}
+
static int mem_control_stat_show(struct cgroup *cont, struct cftype *cft,
struct seq_file *m)
{
struct mem_cgroup *memcg = mem_cgroup_from_cont(cont);
- struct mcs_total_stat mystat;
- int i;
-
- memset(&mystat, 0, sizeof(mystat));
- mem_cgroup_get_local_stat(memcg, &mystat);
+ struct mem_cgroup *mi;
+ unsigned int i;

-
- for (i = 0; i < NR_MCS_STAT; i++) {
- if (i == MCS_SWAP && !do_swap_account)
+ for (i = 0; i < MEM_CGROUP_STAT_NSTATS; i++) {
+ if (i == MEM_CGROUP_STAT_SWAPOUT && !do_swap_account)
continue;
- seq_printf(m, "%s %llu\n", memcg_stat_strings[i],
- (unsigned long long)mystat.stat[i]);
+ seq_printf(m, "%s %ld\n", mem_cgroup_stat_names[i],
+ mem_cgroup_read_stat(memcg, i) * PAGE_SIZE);
}

+ for (i = 0; i < MEM_CGROUP_EVENTS_NSTATS; i++)
+ seq_printf(m, "%s %lu\n", mem_cgroup_events_names[i],
+ mem_cgroup_read_events(memcg, i));
+
+ for (i = 0; i < NR_LRU_LISTS; i++)
+ seq_printf(m, "%s %lu\n", mem_cgroup_lru_names[i],
+ mem_cgroup_nr_lru_pages(memcg, BIT(i)) * PAGE_SIZE);
+
/* Hierarchical information */
{
unsigned long long limit, memsw_limit;
@@ -4416,13 +4357,31 @@ static int mem_control_stat_show(struct cgroup *cont, struct cftype *cft,
memsw_limit);
}

- memset(&mystat, 0, sizeof(mystat));
- mem_cgroup_get_total_stat(memcg, &mystat);
- for (i = 0; i < NR_MCS_STAT; i++) {
- if (i == MCS_SWAP && !do_swap_account)
+ for (i = 0; i < MEM_CGROUP_STAT_NSTATS; i++) {
+ long long val = 0;
+
+ if (i == MEM_CGROUP_STAT_SWAPOUT && !do_swap_account)
continue;
- seq_printf(m, "total_%s %llu\n", memcg_stat_strings[i],
- (unsigned long long)mystat.stat[i]);
+ for_each_mem_cgroup_tree(mi, memcg)
+ val += mem_cgroup_read_stat(mi, i) * PAGE_SIZE;
+ seq_printf(m, "total_%s %lld\n", mem_cgroup_stat_names[i], val);
+ }
+
+ for (i = 0; i < MEM_CGROUP_EVENTS_NSTATS; i++) {
+ unsigned long long val = 0;
+
+ for_each_mem_cgroup_tree(mi, memcg)
+ val += mem_cgroup_read_events(mi, i);
+ seq_printf(m, "total_%s %llu\n",
+ mem_cgroup_events_names[i], val);
+ }
+
+ for (i = 0; i < NR_LRU_LISTS; i++) {
+ unsigned long long val = 0;
+
+ for_each_mem_cgroup_tree(mi, memcg)
+ val += mem_cgroup_nr_lru_pages(mi, BIT(i)) * PAGE_SIZE;
+ seq_printf(m, "total_%s %llu\n", mem_cgroup_lru_names[i], val);
}

#ifdef CONFIG_DEBUG_VM
--
1.7.10.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


mhocko at suse

May 15, 2012, 8:27 AM

Post #2 of 5 (102 views)
Permalink
Re: [patch 6/6] mm: memcg: print statistics from live counters [In reply to]

On Mon 14-05-12 20:00:51, Johannes Weiner wrote:
> Directly print statistics and event counters instead of going through
> an intermediate accumulation stage into a separate array, which used
> to require defining statistic items in more than one place.
>
> Signed-off-by: Johannes Weiner <hannes [at] cmpxchg>

Acked-by: Michal Hocko <mhocko [at] suse>

> ---
> mm/memcontrol.c | 173 +++++++++++++++++++++----------------------------------
> 1 file changed, 66 insertions(+), 107 deletions(-)

Nice

>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 3ee63f6..b0d343a 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -102,6 +102,14 @@ enum mem_cgroup_stat_index {
> MEM_CGROUP_STAT_NSTATS,
> };
>
> +static const char *mem_cgroup_stat_names[] = {
> + "cache",
> + "rss",
> + "mapped_file",
> + "mlock",
> + "swap",
> +};
> +
> enum mem_cgroup_events_index {
> MEM_CGROUP_EVENTS_PGPGIN, /* # of pages paged in */
> MEM_CGROUP_EVENTS_PGPGOUT, /* # of pages paged out */
> @@ -109,6 +117,14 @@ enum mem_cgroup_events_index {
> MEM_CGROUP_EVENTS_PGMAJFAULT, /* # of major page-faults */
> MEM_CGROUP_EVENTS_NSTATS,
> };
> +
> +static const char *mem_cgroup_events_names[] = {
> + "pgpgin",
> + "pgpgout",
> + "pgfault",
> + "pgmajfault",
> +};
> +
> /*
> * Per memcg event counter is incremented at every pagein/pageout. With THP,
> * it will be incremated by the number of pages. This counter is used for
> @@ -4250,97 +4266,6 @@ static int mem_cgroup_move_charge_write(struct cgroup *cgrp,
> }
> #endif
>
> -
> -/* For read statistics */
> -enum {
> - MCS_CACHE,
> - MCS_RSS,
> - MCS_FILE_MAPPED,
> - MCS_MLOCK,
> - MCS_SWAP,
> - MCS_PGPGIN,
> - MCS_PGPGOUT,
> - MCS_PGFAULT,
> - MCS_PGMAJFAULT,
> - MCS_INACTIVE_ANON,
> - MCS_ACTIVE_ANON,
> - MCS_INACTIVE_FILE,
> - MCS_ACTIVE_FILE,
> - MCS_UNEVICTABLE,
> - NR_MCS_STAT,
> -};
> -
> -struct mcs_total_stat {
> - s64 stat[NR_MCS_STAT];
> -};
> -
> -static const char *memcg_stat_strings[NR_MCS_STAT] = {
> - "cache",
> - "rss",
> - "mapped_file",
> - "mlock",
> - "swap",
> - "pgpgin",
> - "pgpgout",
> - "pgfault",
> - "pgmajfault",
> - "inactive_anon",
> - "active_anon",
> - "inactive_file",
> - "active_file",
> - "unevictable",
> -};
> -
> -
> -static void
> -mem_cgroup_get_local_stat(struct mem_cgroup *memcg, struct mcs_total_stat *s)
> -{
> - s64 val;
> -
> - /* per cpu stat */
> - val = mem_cgroup_read_stat(memcg, MEM_CGROUP_STAT_CACHE);
> - s->stat[MCS_CACHE] += val * PAGE_SIZE;
> - val = mem_cgroup_read_stat(memcg, MEM_CGROUP_STAT_RSS);
> - s->stat[MCS_RSS] += val * PAGE_SIZE;
> - val = mem_cgroup_read_stat(memcg, MEM_CGROUP_STAT_FILE_MAPPED);
> - s->stat[MCS_FILE_MAPPED] += val * PAGE_SIZE;
> - val = mem_cgroup_read_stat(memcg, MEM_CGROUP_STAT_MLOCK);
> - s->stat[MCS_MLOCK] += val * PAGE_SIZE;
> - if (do_swap_account) {
> - val = mem_cgroup_read_stat(memcg, MEM_CGROUP_STAT_SWAPOUT);
> - s->stat[MCS_SWAP] += val * PAGE_SIZE;
> - }
> - val = mem_cgroup_read_events(memcg, MEM_CGROUP_EVENTS_PGPGIN);
> - s->stat[MCS_PGPGIN] += val;
> - val = mem_cgroup_read_events(memcg, MEM_CGROUP_EVENTS_PGPGOUT);
> - s->stat[MCS_PGPGOUT] += val;
> - val = mem_cgroup_read_events(memcg, MEM_CGROUP_EVENTS_PGFAULT);
> - s->stat[MCS_PGFAULT] += val;
> - val = mem_cgroup_read_events(memcg, MEM_CGROUP_EVENTS_PGMAJFAULT);
> - s->stat[MCS_PGMAJFAULT] += val;
> -
> - /* per zone stat */
> - val = mem_cgroup_nr_lru_pages(memcg, BIT(LRU_INACTIVE_ANON));
> - s->stat[MCS_INACTIVE_ANON] += val * PAGE_SIZE;
> - val = mem_cgroup_nr_lru_pages(memcg, BIT(LRU_ACTIVE_ANON));
> - s->stat[MCS_ACTIVE_ANON] += val * PAGE_SIZE;
> - val = mem_cgroup_nr_lru_pages(memcg, BIT(LRU_INACTIVE_FILE));
> - s->stat[MCS_INACTIVE_FILE] += val * PAGE_SIZE;
> - val = mem_cgroup_nr_lru_pages(memcg, BIT(LRU_ACTIVE_FILE));
> - s->stat[MCS_ACTIVE_FILE] += val * PAGE_SIZE;
> - val = mem_cgroup_nr_lru_pages(memcg, BIT(LRU_UNEVICTABLE));
> - s->stat[MCS_UNEVICTABLE] += val * PAGE_SIZE;
> -}
> -
> -static void
> -mem_cgroup_get_total_stat(struct mem_cgroup *memcg, struct mcs_total_stat *s)
> -{
> - struct mem_cgroup *iter;
> -
> - for_each_mem_cgroup_tree(iter, memcg)
> - mem_cgroup_get_local_stat(iter, s);
> -}
> -
> #ifdef CONFIG_NUMA
> static int mem_control_numa_stat_show(struct cgroup *cont, struct cftype *cft,
> struct seq_file *m)
> @@ -4388,24 +4313,40 @@ static int mem_control_numa_stat_show(struct cgroup *cont, struct cftype *cft,
> }
> #endif /* CONFIG_NUMA */
>
> +static const char *mem_cgroup_lru_names[] = {
> + "inactive_anon",
> + "active_anon",
> + "inactive_file",
> + "active_file",
> + "unevictable",
> +};
> +static inline void mem_cgroup_lru_names_not_uptodate(void)
> +{
> + BUILD_BUG_ON(ARRAY_SIZE(mem_cgroup_lru_names) != NR_LRU_LISTS);
> +}
> +
> static int mem_control_stat_show(struct cgroup *cont, struct cftype *cft,
> struct seq_file *m)
> {
> struct mem_cgroup *memcg = mem_cgroup_from_cont(cont);
> - struct mcs_total_stat mystat;
> - int i;
> -
> - memset(&mystat, 0, sizeof(mystat));
> - mem_cgroup_get_local_stat(memcg, &mystat);
> + struct mem_cgroup *mi;
> + unsigned int i;
>
> -
> - for (i = 0; i < NR_MCS_STAT; i++) {
> - if (i == MCS_SWAP && !do_swap_account)
> + for (i = 0; i < MEM_CGROUP_STAT_NSTATS; i++) {
> + if (i == MEM_CGROUP_STAT_SWAPOUT && !do_swap_account)
> continue;
> - seq_printf(m, "%s %llu\n", memcg_stat_strings[i],
> - (unsigned long long)mystat.stat[i]);
> + seq_printf(m, "%s %ld\n", mem_cgroup_stat_names[i],
> + mem_cgroup_read_stat(memcg, i) * PAGE_SIZE);
> }
>
> + for (i = 0; i < MEM_CGROUP_EVENTS_NSTATS; i++)
> + seq_printf(m, "%s %lu\n", mem_cgroup_events_names[i],
> + mem_cgroup_read_events(memcg, i));
> +
> + for (i = 0; i < NR_LRU_LISTS; i++)
> + seq_printf(m, "%s %lu\n", mem_cgroup_lru_names[i],
> + mem_cgroup_nr_lru_pages(memcg, BIT(i)) * PAGE_SIZE);
> +
> /* Hierarchical information */
> {
> unsigned long long limit, memsw_limit;
> @@ -4416,13 +4357,31 @@ static int mem_control_stat_show(struct cgroup *cont, struct cftype *cft,
> memsw_limit);
> }
>
> - memset(&mystat, 0, sizeof(mystat));
> - mem_cgroup_get_total_stat(memcg, &mystat);
> - for (i = 0; i < NR_MCS_STAT; i++) {
> - if (i == MCS_SWAP && !do_swap_account)
> + for (i = 0; i < MEM_CGROUP_STAT_NSTATS; i++) {
> + long long val = 0;
> +
> + if (i == MEM_CGROUP_STAT_SWAPOUT && !do_swap_account)
> continue;
> - seq_printf(m, "total_%s %llu\n", memcg_stat_strings[i],
> - (unsigned long long)mystat.stat[i]);
> + for_each_mem_cgroup_tree(mi, memcg)
> + val += mem_cgroup_read_stat(mi, i) * PAGE_SIZE;
> + seq_printf(m, "total_%s %lld\n", mem_cgroup_stat_names[i], val);
> + }
> +
> + for (i = 0; i < MEM_CGROUP_EVENTS_NSTATS; i++) {
> + unsigned long long val = 0;
> +
> + for_each_mem_cgroup_tree(mi, memcg)
> + val += mem_cgroup_read_events(mi, i);
> + seq_printf(m, "total_%s %llu\n",
> + mem_cgroup_events_names[i], val);
> + }
> +
> + for (i = 0; i < NR_LRU_LISTS; i++) {
> + unsigned long long val = 0;
> +
> + for_each_mem_cgroup_tree(mi, memcg)
> + val += mem_cgroup_nr_lru_pages(mi, BIT(i)) * PAGE_SIZE;
> + seq_printf(m, "total_%s %llu\n", mem_cgroup_lru_names[i], val);
> }
>
> #ifdef CONFIG_DEBUG_VM
> --
> 1.7.10.1
>

--
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9
Czech Republic
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


akpm at linux-foundation

May 16, 2012, 4:01 PM

Post #3 of 5 (102 views)
Permalink
Re: [patch 6/6] mm: memcg: print statistics from live counters [In reply to]

On Mon, 14 May 2012 20:00:51 +0200
Johannes Weiner <hannes [at] cmpxchg> wrote:

> Directly print statistics and event counters instead of going through
> an intermediate accumulation stage into a separate array, which used
> to require defining statistic items in more than one place.
>
> ...
>
> -static const char *memcg_stat_strings[NR_MCS_STAT] = {
> - "cache",
> - "rss",
> - "mapped_file",

Bah humbug, who went and called this mapped_file?

This stat is derived from MEM_CGROUP_STAT_FILE_MAPPED. But if we
rename MEM_CGROUP_STAT_FILE_MAPPED to MEM_CGROUP_STAT_MAPPED_FILE then
we also need to rename the non-memcg NR_FILE_MAPPED. And we can't
change the text to "file_mapped" because it's ABI.

> - "mlock",
> - "swap",

And "swap" is derived from MEM_CGROUP_STAT_SWAPOUT. We could rename
that to MEM_CGROUP_STAT_SWAP without trouble.

But both are poor names. There are two concepts here: a) swapout
events (ie: swap writeout initiation) and b) swapspace usage. Type a)
only ever counts up, whereas type b) counts up and down.

MEM_CGROUP_STAT_SWAPOUT is actually of type b), but "swapout" is a
misleading term, because it refers to type a) events.

And the human-displayed "swap" is useless because it can refer to
either type a) or type b) events. These should be called "swapped" and
MEM_CGROUP_STAT_SWAPPED. But we can't change the userspace interface.

argh, I hate you all!

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


kamezawa.hiroyu at jp

May 16, 2012, 5:01 PM

Post #4 of 5 (99 views)
Permalink
Re: [patch 6/6] mm: memcg: print statistics from live counters [In reply to]

(2012/05/17 8:01), Andrew Morton wrote:

> On Mon, 14 May 2012 20:00:51 +0200
> Johannes Weiner <hannes [at] cmpxchg> wrote:
>
>> Directly print statistics and event counters instead of going through
>> an intermediate accumulation stage into a separate array, which used
>> to require defining statistic items in more than one place.
>>
>> ...
>>
>> -static const char *memcg_stat_strings[NR_MCS_STAT] = {
>> - "cache",
>> - "rss",
>> - "mapped_file",
>
> Bah humbug, who went and called this mapped_file?
>
> This stat is derived from MEM_CGROUP_STAT_FILE_MAPPED. But if we
> rename MEM_CGROUP_STAT_FILE_MAPPED to MEM_CGROUP_STAT_MAPPED_FILE then
> we also need to rename the non-memcg NR_FILE_MAPPED. And we can't
> change the text to "file_mapped" because it's ABI.
>


Sorry..

>> - "mlock",
>> - "swap",
>
> And "swap" is derived from MEM_CGROUP_STAT_SWAPOUT. We could rename
> that to MEM_CGROUP_STAT_SWAP without trouble.
>

Yes.

> But both are poor names. There are two concepts here: a) swapout
> events (ie: swap writeout initiation) and b) swapspace usage. Type a)
> only ever counts up, whereas type b) counts up and down.
>
> MEM_CGROUP_STAT_SWAPOUT is actually of type b), but "swapout" is a
> misleading term, because it refers to type a) events.
>

I'll prepare a patch.

> And the human-displayed "swap" is useless because it can refer to
> either type a) or type b) events. These should be called "swapped" and
> MEM_CGROUP_STAT_SWAPPED. But we can't change the userspace interface.
>
> argh, I hate you all!
>

Hm...sorry. I(fujitsu) am now considering to add meminfo for memcg...,

add an option to override /proc/meminfo if a task is in container or
meminfo file somewhere.
(Now, we cannot trust /usr/bin/free, /usr/bin/top etc...in a container.)

so...I think usual user experience will be better because of the same format
with meminfo.

Thanks,
-Kame


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


glommer at parallels

May 17, 2012, 3:56 AM

Post #5 of 5 (100 views)
Permalink
Re: [patch 6/6] mm: memcg: print statistics from live counters [In reply to]

On 05/17/2012 04:01 AM, KAMEZAWA Hiroyuki wrote:
> Hm...sorry. I(fujitsu) am now considering to add meminfo for memcg...,
>
> add an option to override /proc/meminfo if a task is in container or
> meminfo file somewhere.
> (Now, we cannot trust /usr/bin/free, /usr/bin/top etc...in a container.)

Yes, and all the previous times I tried to touch those, I think the
general agreement was to come up with some kind of fuse overlay that
would read information available from the kernel, and present it
correctly formatted through bind-mounts on the files of interest.

But that's mainly because we never reached agreement on how to make that
appear automatically from such tasks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.