linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] memcg: drop type MEM_CGROUP_CHARGE_TYPE_DROP
@ 2011-12-07 10:30 Bob Liu
  2011-12-07 11:03 ` KAMEZAWA Hiroyuki
  2011-12-07 14:22 ` Johannes Weiner
  0 siblings, 2 replies; 6+ messages in thread
From: Bob Liu @ 2011-12-07 10:30 UTC (permalink / raw)
  To: linux-mm; +Cc: akpm, kamezawa.hiroyu, jweiner, mhocko, Bob Liu

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 <lliubbo@gmail.com>
---
 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;
-
 	memcg = __mem_cgroup_uncharge_common(page, ctype);
 
 	/*
-- 
1.7.0.4


--
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] 6+ messages in thread

end of thread, other threads:[~2011-12-08 10:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-07 10:30 [PATCH] memcg: drop type MEM_CGROUP_CHARGE_TYPE_DROP Bob Liu
2011-12-07 11:03 ` KAMEZAWA Hiroyuki
2011-12-07 12:29   ` Bob Liu
2011-12-08  1:42     ` KAMEZAWA Hiroyuki
2011-12-08 10:34       ` Bob Liu
2011-12-07 14:22 ` 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).