Re: [RFC][BUGFIX][PATCH] memcg: fix underflow of mapped_file stat

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Daisuke Nishimura
Date: Tuesday, April 13, 2010 - 10:31 pm

On Wed, 14 Apr 2010 12:06:22 +0900, KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
Great! I like this change very much.

Some comments are inlined.

it should be:

	*ptr = mem;
	ret = __mem_cgroup_try_charge(NULL, GFP_KERNEL, ptr, false);
	css_put(&mem->css);

as Andrea has fixed already.

I think using page_is_file_cache() would be better.

unnecessary extra line :)

hmm... using mem_cgroup_uncharge_page() would be enough, but I think it doesn't
show what we want: we must uncharge "unused" by all means in PageCgroupUsed case,
and I feel it strange a bit to uncharge "unused" by mem_cgroup_uncharge_page(),
if it *was* a cache page.
So I think __mem_cgroup_uncharge_common(unused, MEM_CGROUP_CHARGE_TYPE_FORCE)
would be better, otherwise we need more comments to explain why
mem_cgroup_uncharge_page() is enough.

And if newpage was removed from radix-tree after unlock_page(),
the context which removed it from radix-tree uncharges it properly, because
it is charged at prepare_migration.

right?

mem_cgroup_uncharge_page() does the same check :)


Thanks,
Daisuke Nishimura.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC][BUGFIX][PATCH] memcg: fix underflow of mapped_file stat, Daisuke Nishimura, (Mon Apr 12, 9:42 pm)
Re: [RFC][BUGFIX][PATCH] memcg: fix underflow of mapped_fi ..., KAMEZAWA Hiroyuki, (Mon Apr 12, 11:14 pm)
Re: [RFC][BUGFIX][PATCH] memcg: fix underflow of mapped_fi ..., Daisuke Nishimura, (Tue Apr 13, 5:54 pm)
Re: [RFC][BUGFIX][PATCH] memcg: fix underflow of mapped_fi ..., KAMEZAWA Hiroyuki, (Tue Apr 13, 6:03 pm)
Re: [RFC][BUGFIX][PATCH] memcg: fix underflow of mapped_fi ..., KAMEZAWA Hiroyuki, (Tue Apr 13, 6:40 pm)
Re: [RFC][BUGFIX][PATCH] memcg: fix underflow of mapped_fi ..., KAMEZAWA Hiroyuki, (Tue Apr 13, 6:56 pm)
Re: [RFC][BUGFIX][PATCH] memcg: fix underflow of mapped_fi ..., KAMEZAWA Hiroyuki, (Tue Apr 13, 8:06 pm)
Re: [RFC][BUGFIX][PATCH] memcg: fix underflow of mapped_fi ..., Daisuke Nishimura, (Tue Apr 13, 10:31 pm)
Re: [RFC][BUGFIX][PATCH] memcg: fix underflow of mapped_fi ..., KAMEZAWA Hiroyuki, (Tue Apr 13, 10:40 pm)
Re: [RFC][BUGFIX][PATCH] memcg: fix underflow of mapped_fi ..., Daisuke Nishimura, (Wed Apr 14, 7:22 pm)
[RFC][BUGFIX][PATCH 1/2] memcg: fix charge bypass route of ..., KAMEZAWA Hiroyuki, (Wed Apr 14, 8:05 pm)
[RFC][BUGFIX][PATCH 2/2] memcg: fix file mapped underflow ..., KAMEZAWA Hiroyuki, (Wed Apr 14, 8:06 pm)
Re: [RFC][BUGFIX][PATCH 1/2] memcg: fix charge bypass rout ..., Daisuke Nishimura, (Wed Apr 14, 11:43 pm)
Re: [RFC][BUGFIX][PATCH 1/2] memcg: fix charge bypass rout ..., KAMEZAWA Hiroyuki, (Wed Apr 14, 11:56 pm)
[RFC][BUGFIX][PATCH 2/2] memcg: fix file mapped underflow ..., KAMEZAWA Hiroyuki, (Fri Apr 16, 3:31 am)
Interleave policy on 2M pages (was Re: [RFC][BUGFIX][PATCH ..., Christoph Lameter, (Fri Apr 16, 9:13 am)
Re: Interleave policy on 2M pages (was Re: [RFC][BUGFIX][P ..., Andrea Arcangeli, (Fri Apr 16, 10:51 am)
Re: [RFC][BUGFIX][PATCH 2/2] memcg: fix file mapped underf ..., Daisuke Nishimura, (Sun Apr 18, 8:42 pm)
Re: [RFC][BUGFIX][PATCH 2/2] memcg: fix file mapped underf ..., KAMEZAWA Hiroyuki, (Sun Apr 18, 9:18 pm)
Re: [RFC][BUGFIX][PATCH 2/2] memcg: fix file mapped underf ..., Daisuke Nishimura, (Mon Apr 19, 1:07 am)
Re: [RFC][BUGFIX][PATCH 2/2] memcg: fix file mapped underf ..., KAMEZAWA Hiroyuki, (Mon Apr 19, 1:26 am)
Re: [RFC][BUGFIX][PATCH 2/2] memcg: fix file mapped underf ..., Daisuke Nishimura, (Mon Apr 19, 9:20 pm)
Re: [RFC][BUGFIX][PATCH 2/2] memcg: fix file mapped underf ..., KAMEZAWA Hiroyuki, (Mon Apr 19, 9:26 pm)
Re: [RFC][BUGFIX][PATCH 2/2] memcg: fix file mapped underf ..., KAMEZAWA Hiroyuki, (Tue Apr 20, 2:19 am)
Re: [RFC][BUGFIX][PATCH 2/2] memcg: fix file mapped underf ..., Daisuke Nishimura, (Fri Apr 23, 1:08 am)
Re: [RFC][BUGFIX][PATCH 2/2] memcg: fix file mapped underf ..., KAMEZAWA Hiroyuki, (Fri Apr 23, 1:23 am)