* [PATCH] memcg: fix event counting breakage by recent THP update
@ 2011-02-01 0:12 KAMEZAWA Hiroyuki
2011-02-01 9:34 ` Johannes Weiner
0 siblings, 1 reply; 2+ messages in thread
From: KAMEZAWA Hiroyuki @ 2011-02-01 0:12 UTC (permalink / raw)
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
hannes@cmpxchg.org, nishimura@mxp.nes.nec.co.jp,
balbir@linux.vnet.ibm.com
Thanks to Johannes for catching this.
And sorry for my patch, I'd like to consinder some debug check..
=
Changes in commit e401f1761c0b01966e36e41e2c385d455a7b44ee
adds nr_pages to support multiple page size in memory_cgroup_charge_statistics.
But counting the number of event nees abs(nr_pages) for increasing
counters. This patch fixes event counting.
Reported-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
mm/memcontrol.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: mmotm-0125/mm/memcontrol.c
===================================================================
--- mmotm-0125.orig/mm/memcontrol.c
+++ mmotm-0125/mm/memcontrol.c
@@ -612,8 +612,10 @@ static void mem_cgroup_charge_statistics
/* pagein of a big page is an event. So, ignore page size */
if (nr_pages > 0)
__this_cpu_inc(mem->stat->count[MEM_CGROUP_STAT_PGPGIN_COUNT]);
- else
+ else {
__this_cpu_inc(mem->stat->count[MEM_CGROUP_STAT_PGPGOUT_COUNT]);
+ nr_pages = -nr_pages; /* for event */
+ }
__this_cpu_add(mem->stat->count[MEM_CGROUP_EVENTS], nr_pages);
--
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 policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] memcg: fix event counting breakage by recent THP update
2011-02-01 0:12 [PATCH] memcg: fix event counting breakage by recent THP update KAMEZAWA Hiroyuki
@ 2011-02-01 9:34 ` Johannes Weiner
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Weiner @ 2011-02-01 9:34 UTC (permalink / raw)
To: KAMEZAWA Hiroyuki
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, nishimura@mxp.nes.nec.co.jp,
balbir@linux.vnet.ibm.com
On Tue, Feb 01, 2011 at 09:12:08AM +0900, KAMEZAWA Hiroyuki wrote:
>
> Thanks to Johannes for catching this.
> And sorry for my patch, I'd like to consinder some debug check..
> =
> Changes in commit e401f1761c0b01966e36e41e2c385d455a7b44ee
> adds nr_pages to support multiple page size in memory_cgroup_charge_statistics.
>
> But counting the number of event nees abs(nr_pages) for increasing
> counters. This patch fixes event counting.
>
> Reported-by: Johannes Weiner <hannes@cmpxchg.org>
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reviewed-by: Johannes Weiner <hannes@cmpxchg.org>
--
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 policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-02-01 9:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-01 0:12 [PATCH] memcg: fix event counting breakage by recent THP update KAMEZAWA Hiroyuki
2011-02-01 9:34 ` Johannes Weiner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).