From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx122.postini.com [74.125.245.122]) by kanga.kvack.org (Postfix) with SMTP id D5CA56B004F for ; Wed, 7 Dec 2011 09:22:28 -0500 (EST) Date: Wed, 7 Dec 2011 15:22:22 +0100 From: Johannes Weiner Subject: Re: [PATCH] memcg: drop type MEM_CGROUP_CHARGE_TYPE_DROP Message-ID: <20111207142222.GA12679@redhat.com> References: <1323253846-21245-1-git-send-email-lliubbo@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1323253846-21245-1-git-send-email-lliubbo@gmail.com> Sender: owner-linux-mm@kvack.org List-ID: To: Bob Liu Cc: linux-mm@kvack.org, akpm@linux-foundation.org, kamezawa.hiroyu@jp.fujitsu.com, mhocko@suse.cz On Wed, Dec 07, 2011 at 06:30:46PM +0800, Bob Liu wrote: > uncharge will happen only when !page_mapped(page) no matter MEM_CGROUP_CHARGE_TYPE_DROP > or MEM_CGROUP_CHARGE_TYPE_SWAPOUT when called from mem_cgroup_uncharge_swapcache(). > i think it's no difference, so drop it. > > Signed-off-by: Bob Liu > --- > mm/memcontrol.c | 5 ----- > 1 files changed, 0 insertions(+), 5 deletions(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 6aff93c..02a2988 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -339,7 +339,6 @@ enum charge_type { > MEM_CGROUP_CHARGE_TYPE_SHMEM, /* used by page migration of shmem */ > MEM_CGROUP_CHARGE_TYPE_FORCE, /* used by force_empty */ > MEM_CGROUP_CHARGE_TYPE_SWAPOUT, /* for accounting swapcache */ > - MEM_CGROUP_CHARGE_TYPE_DROP, /* a page was unused swap cache */ > NR_CHARGE_TYPE, > }; > > @@ -3000,7 +2999,6 @@ __mem_cgroup_uncharge_common(struct page *page, enum charge_type ctype) > > switch (ctype) { > case MEM_CGROUP_CHARGE_TYPE_MAPPED: > - case MEM_CGROUP_CHARGE_TYPE_DROP: > /* See mem_cgroup_prepare_migration() */ > if (page_mapped(page) || PageCgroupMigration(pc)) > goto unlock_out; > @@ -3121,9 +3119,6 @@ mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout) > struct mem_cgroup *memcg; > int ctype = MEM_CGROUP_CHARGE_TYPE_SWAPOUT; > > - if (!swapout) /* this was a swap cache but the swap is unused ! */ > - ctype = MEM_CGROUP_CHARGE_TYPE_DROP; > - Pages are in swap cache for swapping in as well as for swapping out. When a page is removed from swap cache and memory, the accounting needs to know about the direction. See the other checks against TYPE_SWAPOUT. -- 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: email@kvack.org