linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] memcg: more mem_cgroup_uncharge batching
@ 2011-02-24  5:44 Hugh Dickins
  2011-02-24  5:50 ` KAMEZAWA Hiroyuki
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Hugh Dickins @ 2011-02-24  5:44 UTC (permalink / raw)
  To: KAMEZAWA Hiroyuki
  Cc: Andrew Morton, Balbir Singh, Daisuke Nishimura, linux-kernel, linux-mm

It seems odd that truncate_inode_pages_range(), called not only when
truncating but also when evicting inodes, has mem_cgroup_uncharge_start
and _end() batching in its second loop to clear up a few leftovers, but
not in its first loop that does almost all the work: add them there too.

Signed-off-by: Hugh Dickins <hughd@google.com>
---

 mm/truncate.c |    2 ++
 1 file changed, 2 insertions(+)

--- 2.6.38-rc6/mm/truncate.c	2011-01-21 20:54:14.000000000 -0800
+++ linux/mm/truncate.c	2011-02-23 16:12:19.000000000 -0800
@@ -225,6 +225,7 @@ void truncate_inode_pages_range(struct a
 	next = start;
 	while (next <= end &&
 	       pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE)) {
+		mem_cgroup_uncharge_start();
 		for (i = 0; i < pagevec_count(&pvec); i++) {
 			struct page *page = pvec.pages[i];
 			pgoff_t page_index = page->index;
@@ -247,6 +248,7 @@ void truncate_inode_pages_range(struct a
 			unlock_page(page);
 		}
 		pagevec_release(&pvec);
+		mem_cgroup_uncharge_end();
 		cond_resched();
 	}
 

--
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	[flat|nested] 4+ messages in thread

* Re: [PATCH] memcg: more mem_cgroup_uncharge batching
  2011-02-24  5:44 [PATCH] memcg: more mem_cgroup_uncharge batching Hugh Dickins
@ 2011-02-24  5:50 ` KAMEZAWA Hiroyuki
  2011-02-24  6:19 ` Balbir Singh
  2011-02-24  6:47 ` Daisuke Nishimura
  2 siblings, 0 replies; 4+ messages in thread
From: KAMEZAWA Hiroyuki @ 2011-02-24  5:50 UTC (permalink / raw)
  To: Hugh Dickins
  Cc: Andrew Morton, Balbir Singh, Daisuke Nishimura, linux-kernel, linux-mm

On Wed, 23 Feb 2011 21:44:33 -0800 (PST)
Hugh Dickins <hughd@google.com> wrote:

> It seems odd that truncate_inode_pages_range(), called not only when
> truncating but also when evicting inodes, has mem_cgroup_uncharge_start
> and _end() batching in its second loop to clear up a few leftovers, but
> not in its first loop that does almost all the work: add them there too.
> 
> Signed-off-by: Hugh Dickins <hughd@google.com>

Thank you.
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

--
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	[flat|nested] 4+ messages in thread

* Re: [PATCH] memcg: more mem_cgroup_uncharge batching
  2011-02-24  5:44 [PATCH] memcg: more mem_cgroup_uncharge batching Hugh Dickins
  2011-02-24  5:50 ` KAMEZAWA Hiroyuki
@ 2011-02-24  6:19 ` Balbir Singh
  2011-02-24  6:47 ` Daisuke Nishimura
  2 siblings, 0 replies; 4+ messages in thread
From: Balbir Singh @ 2011-02-24  6:19 UTC (permalink / raw)
  To: Hugh Dickins
  Cc: KAMEZAWA Hiroyuki, Andrew Morton, Daisuke Nishimura,
	linux-kernel, linux-mm

* Hugh Dickins <hughd@google.com> [2011-02-23 21:44:33]:

> It seems odd that truncate_inode_pages_range(), called not only when
> truncating but also when evicting inodes, has mem_cgroup_uncharge_start
> and _end() batching in its second loop to clear up a few leftovers, but
> not in its first loop that does almost all the work: add them there too.
> 
> Signed-off-by: Hugh Dickins <hughd@google.com>
> ---


Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
 

-- 
	Three Cheers,
	Balbir

--
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	[flat|nested] 4+ messages in thread

* Re: [PATCH] memcg: more mem_cgroup_uncharge batching
  2011-02-24  5:44 [PATCH] memcg: more mem_cgroup_uncharge batching Hugh Dickins
  2011-02-24  5:50 ` KAMEZAWA Hiroyuki
  2011-02-24  6:19 ` Balbir Singh
@ 2011-02-24  6:47 ` Daisuke Nishimura
  2 siblings, 0 replies; 4+ messages in thread
From: Daisuke Nishimura @ 2011-02-24  6:47 UTC (permalink / raw)
  To: Hugh Dickins
  Cc: KAMEZAWA Hiroyuki, Andrew Morton, Balbir Singh,
	Daisuke Nishimura, linux-kernel, linux-mm

On Wed, 23 Feb 2011 21:44:33 -0800 (PST)
Hugh Dickins <hughd@google.com> wrote:

> It seems odd that truncate_inode_pages_range(), called not only when
> truncating but also when evicting inodes, has mem_cgroup_uncharge_start
> and _end() batching in its second loop to clear up a few leftovers, but
> not in its first loop that does almost all the work: add them there too.
> 
> Signed-off-by: Hugh Dickins <hughd@google.com>
Thank you catching this. This patch has already got enough ack's, but anyway:

	Acked-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>

P.S.
My address is "nishimura@mxp.nes.nec.co.jp", not "nishmura@mxp.nes.nec.co.jp" :)

--
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	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-24  6:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-24  5:44 [PATCH] memcg: more mem_cgroup_uncharge batching Hugh Dickins
2011-02-24  5:50 ` KAMEZAWA Hiroyuki
2011-02-24  6:19 ` Balbir Singh
2011-02-24  6:47 ` Daisuke Nishimura

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox