linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/hugetlb_cgroup: Add list_del to remove unused page from hugepage_activelist when hugepage migration
@ 2012-07-11  3:51 Wanpeng Li
  2012-07-11  8:32 ` Aneesh Kumar K.V
  0 siblings, 1 reply; 2+ messages in thread
From: Wanpeng Li @ 2012-07-11  3:51 UTC (permalink / raw)
  To: linux-mm
  Cc: Andrew Morton, Li Zefan, Tejun Heo, Aneesh Kumar K.V, cgroups,
	linux-kernel, Wanpeng Li

From: Wanpeng Li <liwp@linux.vnet.ibm.com>

hugepage_activelist is used to track currently used HugeTLB pages.
We can find the in-use HugeTLB pages to support HugeTLB cgroup
removal. Don't keep unused page in hugetlb_activelist too long.
Otherwise, on cgroup removal we should update the unused page's 
charge to parent count. To reduce this overhead, remove unused page 
from hugepage_activelist immediately.

Signed-off-by: Wanpeng Li <liwp.linux@gmail.com>
---
 mm/hugetlb_cgroup.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c
index b834e8d..d819d66 100644
--- a/mm/hugetlb_cgroup.c
+++ b/mm/hugetlb_cgroup.c
@@ -398,6 +398,7 @@ void hugetlb_cgroup_migrate(struct page *oldhpage, struct page *newhpage)
 	spin_lock(&hugetlb_lock);
 	h_cg = hugetlb_cgroup_from_page(oldhpage);
 	set_hugetlb_cgroup(oldhpage, NULL);
+	list_del(&oldhpage->lru);
 
 	/* move the h_cg details to new cgroup */
 	set_hugetlb_cgroup(newhpage, h_cg);
-- 
1.7.5.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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-11  8:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-11  3:51 [PATCH] mm/hugetlb_cgroup: Add list_del to remove unused page from hugepage_activelist when hugepage migration Wanpeng Li
2012-07-11  8:32 ` Aneesh Kumar K.V

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).