aboutsummaryrefslogtreecommitdiffstats
path: root/mm/hugetlb_cgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/hugetlb_cgroup.c')
-rw-r--r--mm/hugetlb_cgroup.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c
index 9834a01c79dc..a3f358fb8a0c 100644
--- a/mm/hugetlb_cgroup.c
+++ b/mm/hugetlb_cgroup.c
@@ -385,6 +385,10 @@ int __init hugetlb_cgroup_file_init(int idx)
385 return 0; 385 return 0;
386} 386}
387 387
388/*
389 * hugetlb_lock will make sure a parallel cgroup rmdir won't happen
390 * when we migrate hugepages
391 */
388void hugetlb_cgroup_migrate(struct page *oldhpage, struct page *newhpage) 392void hugetlb_cgroup_migrate(struct page *oldhpage, struct page *newhpage)
389{ 393{
390 struct hugetlb_cgroup *h_cg; 394 struct hugetlb_cgroup *h_cg;
@@ -397,13 +401,11 @@ void hugetlb_cgroup_migrate(struct page *oldhpage, struct page *newhpage)
397 spin_lock(&hugetlb_lock); 401 spin_lock(&hugetlb_lock);
398 h_cg = hugetlb_cgroup_from_page(oldhpage); 402 h_cg = hugetlb_cgroup_from_page(oldhpage);
399 set_hugetlb_cgroup(oldhpage, NULL); 403 set_hugetlb_cgroup(oldhpage, NULL);
400 cgroup_exclude_rmdir(&h_cg->css);
401 404
402 /* move the h_cg details to new cgroup */ 405 /* move the h_cg details to new cgroup */
403 set_hugetlb_cgroup(newhpage, h_cg); 406 set_hugetlb_cgroup(newhpage, h_cg);
404 list_move(&newhpage->lru, &h->hugepage_activelist); 407 list_move(&newhpage->lru, &h->hugepage_activelist);
405 spin_unlock(&hugetlb_lock); 408 spin_unlock(&hugetlb_lock);
406 cgroup_release_and_wakeup_rmdir(&h_cg->css);
407 return; 409 return;
408} 410}
409 411