Skip to content

Commit 3ccae1d

Browse files
xzpeterakpm00
authored andcommitted
mm/hugetlb: assert hugetlb_lock in __hugetlb_cgroup_commit_charge
This is similar to __hugetlb_cgroup_uncharge_folio() where it relies on holding hugetlb_lock. Add the similar assertion like the other one, since it looks like such things may help some day. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Peter Xu <[email protected]> Reviewed-by: Mina Almasry <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: David Rientjes <[email protected]> Cc: Muchun Song <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 6401a2e commit 3ccae1d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/hugetlb_cgroup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ static void __hugetlb_cgroup_commit_charge(int idx, unsigned long nr_pages,
308308
{
309309
if (hugetlb_cgroup_disabled() || !h_cg)
310310
return;
311-
311+
lockdep_assert_held(&hugetlb_lock);
312312
__set_hugetlb_cgroup(folio, h_cg, rsvd);
313313
if (!rsvd) {
314314
unsigned long usage =

0 commit comments

Comments
 (0)