diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 31b2927ada73f..0c50c4fceb95d 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -713,6 +713,7 @@ HPAGEFLAG(RawHwpUnreliable, raw_hwp_unreliable) /* Defines one hugetlb page size */ struct hstate { struct mutex resize_lock; + struct lock_class_key resize_key; int next_nid_to_alloc; int next_nid_to_free; unsigned int order; diff --git a/mm/hugetlb.c b/mm/hugetlb.c index d35c9e68fb489..a480affd475bf 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4334,7 +4334,7 @@ void __init hugetlb_add_hstate(unsigned int order) BUG_ON(hugetlb_max_hstate >= HUGE_MAX_HSTATE); BUG_ON(order == 0); h = &hstates[hugetlb_max_hstate++]; - mutex_init(&h->resize_lock); + __mutex_init(&h->resize_lock, "resize mutex", &h->resize_key); h->order = order; h->mask = ~(huge_page_size(h) - 1); for (i = 0; i < MAX_NUMNODES; ++i)