mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-23 20:24:12 +08:00
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/20240417211836.2742593-4-peterx@redhat.com Signed-off-by: Peter Xu <peterx@redhat.com> Reviewed-by: Mina Almasry <almasrymina@google.com> Cc: David Hildenbrand <david@redhat.com> Cc: David Rientjes <rientjes@google.com> Cc: Muchun Song <muchun.song@linux.dev> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
6401a2e690
commit
3ccae1dc84
@ -308,7 +308,7 @@ static void __hugetlb_cgroup_commit_charge(int idx, unsigned long nr_pages,
|
||||
{
|
||||
if (hugetlb_cgroup_disabled() || !h_cg)
|
||||
return;
|
||||
|
||||
lockdep_assert_held(&hugetlb_lock);
|
||||
__set_hugetlb_cgroup(folio, h_cg, rsvd);
|
||||
if (!rsvd) {
|
||||
unsigned long usage =
|
||||
|
Loading…
Reference in New Issue
Block a user