* [PATCH] rename MEM_CGROUP_STAT_SWAPOUT as MEM_CGROUP_STAT_NR_SWAP
@ 2012-06-01 10:39 Kamezawa Hiroyuki
[not found] ` <4FC89BC4.9030604-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Kamezawa Hiroyuki @ 2012-06-01 10:39 UTC (permalink / raw)
To: linux-mm; +Cc: cgroups, mhocko, hannes, akpm
MEM_CGROUP_STAT_SWAPOUT represents the usage of swap rather than
the number of swap-out events. Rename it to be MEM_CGROUP_STAT_NR_SWAP.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
mm/memcontrol.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 0121ef3..76bc54c 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -97,7 +97,7 @@ enum mem_cgroup_stat_index {
MEM_CGROUP_STAT_CACHE, /* # of pages charged as cache */
MEM_CGROUP_STAT_RSS, /* # of pages charged as anon rss */
MEM_CGROUP_STAT_FILE_MAPPED, /* # of pages charged as file rss */
- MEM_CGROUP_STAT_SWAPOUT, /* # of pages, swapped out */
+ MEM_CGROUP_STAT_NR_SWAP, /* # of pages, swapped out */
MEM_CGROUP_STAT_NSTATS,
};
@@ -722,7 +722,7 @@ static void mem_cgroup_swap_statistics(struct mem_cgroup *memcg,
bool charge)
{
int val = (charge) ? 1 : -1;
- this_cpu_add(memcg->stat->count[MEM_CGROUP_STAT_SWAPOUT], val);
+ this_cpu_add(memcg->stat->count[MEM_CGROUP_STAT_NR_SWAP], val);
}
static unsigned long mem_cgroup_read_events(struct mem_cgroup *memcg,
@@ -4042,7 +4042,7 @@ static inline u64 mem_cgroup_usage(struct mem_cgroup *memcg, bool swap)
val += mem_cgroup_recursive_stat(memcg, MEM_CGROUP_STAT_RSS);
if (swap)
- val += mem_cgroup_recursive_stat(memcg, MEM_CGROUP_STAT_SWAPOUT);
+ val += mem_cgroup_recursive_stat(memcg, MEM_CGROUP_STAT_NR_SWAP);
return val << PAGE_SHIFT;
}
@@ -4303,7 +4303,7 @@ static int mem_control_stat_show(struct cgroup *cont, struct cftype *cft,
unsigned int i;
for (i = 0; i < MEM_CGROUP_STAT_NSTATS; i++) {
- if (i == MEM_CGROUP_STAT_SWAPOUT && !do_swap_account)
+ if (i == MEM_CGROUP_STAT_NR_SWAP && !do_swap_account)
continue;
seq_printf(m, "%s %ld\n", mem_cgroup_stat_names[i],
mem_cgroup_read_stat(memcg, i) * PAGE_SIZE);
@@ -4330,7 +4330,7 @@ static int mem_control_stat_show(struct cgroup *cont, struct cftype *cft,
for (i = 0; i < MEM_CGROUP_STAT_NSTATS; i++) {
long long val = 0;
- if (i == MEM_CGROUP_STAT_SWAPOUT && !do_swap_account)
+ if (i == MEM_CGROUP_STAT_NR_SWAP && !do_swap_account)
continue;
for_each_mem_cgroup_tree(mi, memcg)
val += mem_cgroup_read_stat(mi, i) * PAGE_SIZE;
--
1.7.4.1
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 5+ messages in thread[parent not found: <4FC89BC4.9030604-+CUm20s59erQFUHtdCDX3A@public.gmane.org>]
* Re: [PATCH] rename MEM_CGROUP_STAT_SWAPOUT as MEM_CGROUP_STAT_NR_SWAP [not found] ` <4FC89BC4.9030604-+CUm20s59erQFUHtdCDX3A@public.gmane.org> @ 2012-06-01 11:11 ` Michal Hocko 2012-06-01 16:53 ` Johannes Weiner 1 sibling, 0 replies; 5+ messages in thread From: Michal Hocko @ 2012-06-01 11:11 UTC (permalink / raw) To: Kamezawa Hiroyuki Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg, cgroups-u79uwXL29TY76Z2rM5mHXA, hannes-druUgvl0LCNAfugRpC6u6w, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b On Fri 01-06-12 19:39:00, KAMEZAWA Hiroyuki wrote: > MEM_CGROUP_STAT_SWAPOUT represents the usage of swap rather than > the number of swap-out events. Rename it to be MEM_CGROUP_STAT_NR_SWAP. > > Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> Acked-by: Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org> > --- > mm/memcontrol.c | 10 +++++----- > 1 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 0121ef3..76bc54c 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -97,7 +97,7 @@ enum mem_cgroup_stat_index { > MEM_CGROUP_STAT_CACHE, /* # of pages charged as cache */ > MEM_CGROUP_STAT_RSS, /* # of pages charged as anon rss */ > MEM_CGROUP_STAT_FILE_MAPPED, /* # of pages charged as file rss */ > - MEM_CGROUP_STAT_SWAPOUT, /* # of pages, swapped out */ > + MEM_CGROUP_STAT_NR_SWAP, /* # of pages, swapped out */ > MEM_CGROUP_STAT_NSTATS, > }; > > @@ -722,7 +722,7 @@ static void mem_cgroup_swap_statistics(struct mem_cgroup *memcg, > bool charge) > { > int val = (charge) ? 1 : -1; > - this_cpu_add(memcg->stat->count[MEM_CGROUP_STAT_SWAPOUT], val); > + this_cpu_add(memcg->stat->count[MEM_CGROUP_STAT_NR_SWAP], val); > } > > static unsigned long mem_cgroup_read_events(struct mem_cgroup *memcg, > @@ -4042,7 +4042,7 @@ static inline u64 mem_cgroup_usage(struct mem_cgroup *memcg, bool swap) > val += mem_cgroup_recursive_stat(memcg, MEM_CGROUP_STAT_RSS); > > if (swap) > - val += mem_cgroup_recursive_stat(memcg, MEM_CGROUP_STAT_SWAPOUT); > + val += mem_cgroup_recursive_stat(memcg, MEM_CGROUP_STAT_NR_SWAP); > > return val << PAGE_SHIFT; > } > @@ -4303,7 +4303,7 @@ static int mem_control_stat_show(struct cgroup *cont, struct cftype *cft, > unsigned int i; > > for (i = 0; i < MEM_CGROUP_STAT_NSTATS; i++) { > - if (i == MEM_CGROUP_STAT_SWAPOUT && !do_swap_account) > + if (i == MEM_CGROUP_STAT_NR_SWAP && !do_swap_account) > continue; > seq_printf(m, "%s %ld\n", mem_cgroup_stat_names[i], > mem_cgroup_read_stat(memcg, i) * PAGE_SIZE); > @@ -4330,7 +4330,7 @@ static int mem_control_stat_show(struct cgroup *cont, struct cftype *cft, > for (i = 0; i < MEM_CGROUP_STAT_NSTATS; i++) { > long long val = 0; > > - if (i == MEM_CGROUP_STAT_SWAPOUT && !do_swap_account) > + if (i == MEM_CGROUP_STAT_NR_SWAP && !do_swap_account) > continue; > for_each_mem_cgroup_tree(mi, memcg) > val += mem_cgroup_read_stat(mi, i) * PAGE_SIZE; > -- > 1.7.4.1 > > > -- > To unsubscribe, send a message with 'unsubscribe linux-mm' in > the body to majordomo-Bw31MaZKKs0EbZ0PF+XxCw@public.gmane.org For more info on Linux MM, > see: http://www.linux-mm.org/ . > Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ > Don't email: <a href=mailto:"dont-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org"> email-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org </a> -- Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] rename MEM_CGROUP_STAT_SWAPOUT as MEM_CGROUP_STAT_NR_SWAP [not found] ` <4FC89BC4.9030604-+CUm20s59erQFUHtdCDX3A@public.gmane.org> 2012-06-01 11:11 ` Michal Hocko @ 2012-06-01 16:53 ` Johannes Weiner [not found] ` <20120601165320.GA1761-druUgvl0LCNAfugRpC6u6w@public.gmane.org> 1 sibling, 1 reply; 5+ messages in thread From: Johannes Weiner @ 2012-06-01 16:53 UTC (permalink / raw) To: Kamezawa Hiroyuki Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg, cgroups-u79uwXL29TY76Z2rM5mHXA, mhocko-AlSwsSmVLrQ, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b On Fri, Jun 01, 2012 at 07:39:00PM +0900, Kamezawa Hiroyuki wrote: > MEM_CGROUP_STAT_SWAPOUT represents the usage of swap rather than > the number of swap-out events. Rename it to be MEM_CGROUP_STAT_NR_SWAP. > > Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> Wouldn't MEM_CGROUP_STAT_SWAP be better? It's equally descriptive but matches the string. And we also don't have NR_ for cache, rss, mapped file etc. ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <20120601165320.GA1761-druUgvl0LCNAfugRpC6u6w@public.gmane.org>]
* Re: [PATCH] rename MEM_CGROUP_STAT_SWAPOUT as MEM_CGROUP_STAT_NR_SWAP [not found] ` <20120601165320.GA1761-druUgvl0LCNAfugRpC6u6w@public.gmane.org> @ 2012-06-01 17:54 ` Hugh Dickins [not found] ` <alpine.LSU.2.00.1206011047430.9814-fupSdm12i1nKWymIFiNcPA@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Hugh Dickins @ 2012-06-01 17:54 UTC (permalink / raw) To: Kamezawa Hiroyuki Cc: Johannes Weiner, linux-mm-Bw31MaZKKs3YtjvyW6yDsg, cgroups-u79uwXL29TY76Z2rM5mHXA, mhocko-AlSwsSmVLrQ, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b On Fri, 1 Jun 2012, Johannes Weiner wrote: > On Fri, Jun 01, 2012 at 07:39:00PM +0900, Kamezawa Hiroyuki wrote: > > MEM_CGROUP_STAT_SWAPOUT represents the usage of swap rather than > > the number of swap-out events. Rename it to be MEM_CGROUP_STAT_NR_SWAP. > > > > Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> > > Wouldn't MEM_CGROUP_STAT_SWAP be better? It's equally descriptive but > matches the string. And we also don't have NR_ for cache, rss, mapped > file etc. That's just what I thought too. You can attach Acked-by: Hugh Dickins <hughd-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> to MEM_CGROUP_STAT_SWAP and MEM_CGROUP_CHARGE_TYPE_ANON. Oh, and to a patch deleting MEM_CGROUP_CHARGE_TYPE_FORCE! Hugh ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <alpine.LSU.2.00.1206011047430.9814-fupSdm12i1nKWymIFiNcPA@public.gmane.org>]
* Re: [PATCH] rename MEM_CGROUP_STAT_SWAPOUT as MEM_CGROUP_STAT_NR_SWAP [not found] ` <alpine.LSU.2.00.1206011047430.9814-fupSdm12i1nKWymIFiNcPA@public.gmane.org> @ 2012-06-04 0:24 ` Kamezawa Hiroyuki 0 siblings, 0 replies; 5+ messages in thread From: Kamezawa Hiroyuki @ 2012-06-04 0:24 UTC (permalink / raw) To: Hugh Dickins Cc: Johannes Weiner, linux-mm-Bw31MaZKKs3YtjvyW6yDsg, cgroups-u79uwXL29TY76Z2rM5mHXA, mhocko-AlSwsSmVLrQ, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b (2012/06/02 2:54), Hugh Dickins wrote: > On Fri, 1 Jun 2012, Johannes Weiner wrote: >> On Fri, Jun 01, 2012 at 07:39:00PM +0900, Kamezawa Hiroyuki wrote: >>> MEM_CGROUP_STAT_SWAPOUT represents the usage of swap rather than >>> the number of swap-out events. Rename it to be MEM_CGROUP_STAT_NR_SWAP. >>> >>> Signed-off-by: KAMEZAWA Hiroyuki<kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> >> >> Wouldn't MEM_CGROUP_STAT_SWAP be better? It's equally descriptive but >> matches the string. And we also don't have NR_ for cache, rss, mapped >> file etc. > > That's just what I thought too. > > You can attach Acked-by: Hugh Dickins<hughd-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> > to MEM_CGROUP_STAT_SWAP and MEM_CGROUP_CHARGE_TYPE_ANON. > > Oh, and to a patch deleting MEM_CGROUP_CHARGE_TYPE_FORCE! > Sure, I'll prepare v2. Thanks, -Kame ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-06-04 0:24 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-01 10:39 [PATCH] rename MEM_CGROUP_STAT_SWAPOUT as MEM_CGROUP_STAT_NR_SWAP Kamezawa Hiroyuki
[not found] ` <4FC89BC4.9030604-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2012-06-01 11:11 ` Michal Hocko
2012-06-01 16:53 ` Johannes Weiner
[not found] ` <20120601165320.GA1761-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2012-06-01 17:54 ` Hugh Dickins
[not found] ` <alpine.LSU.2.00.1206011047430.9814-fupSdm12i1nKWymIFiNcPA@public.gmane.org>
2012-06-04 0:24 ` Kamezawa Hiroyuki
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox