Skip to contentSkip to conversation

compaction: Remove mem_cgroup_del_lru

PATCH In review Minchan Kim 6 participants 9 messages Dec 7, 2010 – Dec 9, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 compaction: Remove mem_cgroup_del_lru

del_page_from_lru_list alreay called mem_cgroup_del_lru. So we need to call it again. It makes wrong stat of memcg and even happen VM_BUG_ON hit.

Cc Balbir Singh <[email protected]>
Cc KAMEZAWA Hiroyuki <[email protected]>
Cc Mel Gorman <[email protected]>
---
 mm/compaction.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
mm/compaction.c +0 -1
index 50b0a90..b0fbfdf 100644
@@ -302,7 +302,6 @@ static unsigned long isolate_migratepages(struct zone *zone,
 		/* Successfully isolated */
 		del_page_from_lru_list(zone, page, page_lru(page));
 		list_add(&page->lru, migratelist);
-		mem_cgroup_del_lru(page);
 		cc->nr_migratepages++;
 		nr_isolated++;
 
Signature · 1 line
1.7.0.4
maintainer
#1 lore raw
Quoted 17 lines · On Wed, 8 Dec 2010 00:01:26 +0900 Minchan Kim <[email protected]> wrote:

del_page_from_lru_list alreay called mem_cgroup_del_lru. So we need to call it again. It makes wrong stat of memcg and even happen VM_BUG_ON hit.

Cc Balbir Singh <[email protected]>
Cc KAMEZAWA Hiroyuki <[email protected]>
Cc Mel Gorman <[email protected]>
---
 mm/compaction.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
mm/compaction.c +0 -0
index 50b0a90..b0fbfdf 100644

mm/compaction.c static unsigned long isolate_migratepages(struct zone *zone, · line 307

Quoted 7 lines
mm/compaction.c +0 -1
@@ -302,7 +302,6 @@ static unsigned long isolate_migratepages(struct zone *zone,
 		/* Successfully isolated */
 		del_page_from_lru_list(zone, page, page_lru(page));
 		list_add(&page->lru, migratelist);
-		mem_cgroup_del_lru(page);
 		cc->nr_migratepages++;
 		nr_isolated++;
 

err, yes, that looks bad.

This bug is present in 2.6.35 and 2.6.36 afaict, so I tagged the fix for -stable backporting.

#2 lore raw
Quoted 30 lines · Andrew Morton
Quoted 17 lines · On Wed,  8 Dec 2010 00:01:26 +0900 Minchan Kim <[email protected]> wrote:

del_page_from_lru_list alreay called mem_cgroup_del_lru. So we need to call it again. It makes wrong stat of memcg and even happen VM_BUG_ON hit.

Cc Balbir Singh <[email protected]>
Cc KAMEZAWA Hiroyuki <[email protected]>
Cc Mel Gorman <[email protected]>

---
 mm/compaction.c |    1 -

 1 files changed, 0 insertions(+), 1 deletions(-)
mm/compaction.c +0 -0
index 50b0a90..b0fbfdf 100644

mm/compaction.c static unsigned long isolate_migratepages(struct zone *zone, · line 307

Quoted 7 lines
mm/compaction.c +0 -1
@@ -302,7 +302,6 @@ static unsigned long isolate_migratepages(struct zone *zone,
               /* Successfully isolated */
               del_page_from_lru_list(zone, page, page_lru(page));
               list_add(&page->lru, migratelist);
-             mem_cgroup_del_lru(page);
               cc->nr_migratepages++;
               nr_isolated++;
 

err, yes, that looks bad.

Quoted 2 lines

This bug is present in 2.6.35 and 2.6.36 afaict, so I tagged the fix for -stable backporting.

Thanks, Andrew.

Quoted 2 lines
Signature · 9 lines
Kind regards,
Minchan Kim

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  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:"[email protected]"> [email protected] </a>
Acked-by on v1 1/1
#3 lore raw
In reply to Minchan Kim
Quoted 8 lines · On Wed, 8 Dec 2010 00:01:26 +0900 Minchan Kim <[email protected]> wrote:

del_page_from_lru_list alreay called mem_cgroup_del_lru. So we need to call it again. It makes wrong stat of memcg and even happen VM_BUG_ON hit.

Cc Balbir Singh <[email protected]>
Cc KAMEZAWA Hiroyuki <[email protected]>
Cc Mel Gorman <[email protected]>

Thank you.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. 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:"[email protected]"> [email protected] </a>

Acked-by on v1 1/1
#4 lore raw
In reply to Minchan Kim
Quoted 9 lines · MinChan Kim

del_page_from_lru_list alreay called mem_cgroup_del_lru. So we need to call it again. It makes wrong stat of memcg and even happen VM_BUG_ON hit.

Cc Balbir Singh <[email protected]>
Cc KAMEZAWA Hiroyuki <[email protected]>
Cc Mel Gorman <[email protected]>

---

Signature · 9 lines
	Three Cheers,
	Balbir

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  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:"[email protected]"> [email protected] </a>
Acked-by on v1 1/1
#5 lore raw
In reply to Minchan Kim
Quoted 8 lines · Minchan Kim

del_page_from_lru_list alreay called mem_cgroup_del_lru. So we need to call it again. It makes wrong stat of memcg and even happen VM_BUG_ON hit.

Cc Balbir Singh <[email protected]>
Cc KAMEZAWA Hiroyuki <[email protected]>
Cc Mel Gorman <[email protected]>

Thanks

Signature · 3 lines
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab
reviewer Reviewed-by on v1 1/1
#6 lore raw
In reply to Minchan Kim
Quoted 8 lines · Minchan Kim

del_page_from_lru_list alreay called mem_cgroup_del_lru. So we need to call it again. It makes wrong stat of memcg and even happen VM_BUG_ON hit.

Cc Balbir Singh <[email protected]>
Cc KAMEZAWA Hiroyuki <[email protected]>
Cc Mel Gorman <[email protected]>

But regarding the severity of this: shouldn't the second deletion attempt be caught by the TestClearPageCgroupAcctLRU() early in mem_cgroup_del_lru_list()?

#7 lore raw
Quoted 10 lines · Johannes Weiner
Quoted 8 lines · Minchan Kim

del_page_from_lru_list alreay called mem_cgroup_del_lru. So we need to call it again. It makes wrong stat of memcg and even happen VM_BUG_ON hit.

Cc Balbir Singh <[email protected]>
Cc KAMEZAWA Hiroyuki <[email protected]>
Cc Mel Gorman <[email protected]>
Quoted 6 lines

But regarding the severity of this: shouldn't the second deletion attempt be caught by the TestClearPageCgroupAcctLRU() early in mem_cgroup_del_lru_list()?

Right, I missed that.
Andrew, I will resend modified description.

Thanks for careful review again, Hannes.

Signature · 2 lines
Kind regards,
Minchan Kim
author Acked-by KAMEZAWA Hiroyuki Acked-by Balbir Singh Acked-by Mel Gorman Reviewed-by Johannes Weiner on v1 1/1
#8 lore raw
In reply to Minchan Kim
Quoted 27 lines · Minchan Kim

del_page_from_lru_list alreay called mem_cgroup_del_lru. So we need to call it again. It makes wrong stat of memcg and even happen VM_BUG_ON hit.

Cc Balbir Singh <[email protected]>
Cc KAMEZAWA Hiroyuki <[email protected]>
Cc Mel Gorman <[email protected]>
---
 mm/compaction.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
mm/compaction.c +0 -1
index 50b0a90..b0fbfdf 100644
@@ -302,7 +302,6 @@ static unsigned long isolate_migratepages(struct zone *zone,
 		/* Successfully isolated */
 		del_page_from_lru_list(zone, page, page_lru(page));
 		list_add(&page->lru, migratelist);
-		mem_cgroup_del_lru(page);
 		cc->nr_migratepages++;
 		nr_isolated++;
 
Signature · 1 line
1.7.0.4

Hi Andrew,
Please drop above(mm-compactionc-avoid-double-mem_cgroup_del_lru.patch) This is a new version with modified description and added Acked-by.

Quoted 1 line

From 64b3a2c1205d3ffc55878ab8f00f4d450318bb91 Mon Sep 17 00:00:00 2001

From: Minchan Kim <[email protected]>
Date: Thu, 9 Dec 2010 23:49:27 +0900
Subject: [PATCH] mm/compaction.c: avoid double mem_cgroup_del_lru()

del_page_from_lru_list() already called mem_cgroup_del_lru(). So we must not call it again. It adds unnecessary overhead.

---
 mm/compaction.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
mm/compaction.c +0 -1
index 50b0a90..b0fbfdf 100644
@@ -302,7 +302,6 @@ static unsigned long isolate_migratepages(struct zone *zone,
 		/* Successfully isolated */
 		del_page_from_lru_list(zone, page, page_lru(page));
 		list_add(&page->lru, migratelist);
-		mem_cgroup_del_lru(page);
 		cc->nr_migratepages++;
 		nr_isolated++;
 
Signature · 6 lines
1.7.0.4


-- 
Kind regards,
Minchan Kim