Skip to content

Commit 7575468

Browse files
kvaneeshtorvalds
authored andcommitted
hugetlb/cgroup: remove exclude and wakeup rmdir calls from migrate
We already hold the hugetlb_lock. That should prevent a parallel cgroup rmdir from touching page's hugetlb cgroup. So remove the exclude and wakeup calls. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Reviewed-by: Michal Hocko <mhocko@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 94ae8ba commit 7575468

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mm/hugetlb_cgroup.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,10 @@ int __init hugetlb_cgroup_file_init(int idx)
385385
return 0;
386386
}
387387

388+
/*
389+
* hugetlb_lock will make sure a parallel cgroup rmdir won't happen
390+
* when we migrate hugepages
391+
*/
388392
void hugetlb_cgroup_migrate(struct page *oldhpage, struct page *newhpage)
389393
{
390394
struct hugetlb_cgroup *h_cg;
@@ -397,13 +401,11 @@ void hugetlb_cgroup_migrate(struct page *oldhpage, struct page *newhpage)
397401
spin_lock(&hugetlb_lock);
398402
h_cg = hugetlb_cgroup_from_page(oldhpage);
399403
set_hugetlb_cgroup(oldhpage, NULL);
400-
cgroup_exclude_rmdir(&h_cg->css);
401404

402405
/* move the h_cg details to new cgroup */
403406
set_hugetlb_cgroup(newhpage, h_cg);
404407
list_move(&newhpage->lru, &h->hugepage_activelist);
405408
spin_unlock(&hugetlb_lock);
406-
cgroup_release_and_wakeup_rmdir(&h_cg->css);
407409
return;
408410
}
409411

0 commit comments

Comments
 (0)