From 2a7864cdd61d315cb97af2a10977d4f2cb51e359 Mon Sep 17 00:00:00 2001 From: Xin Jiang Date: Mon, 16 Oct 2023 13:53:05 +0800 Subject: [PATCH] anolis: mm/hugetlb: misusing spinlock API in isolate_huge_page() ANBZ: #6814 The lock API used is spin_lock_irq(), however, the unlock API is spin_unlock(), that causes the interrupt of CPU is disabled. Fixes: commit 2f20c1b99fff ("hugetlb: make free_huge_page irq safe") Signed-off-by: Yangwencheng Signed-off-by: Xin Jiang --- mm/hugetlb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 4f97fbc334ed..24217fe0bd32 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1608,10 +1608,10 @@ static void __prep_new_huge_page(struct hstate *h, struct page *page) static void prep_new_huge_page(struct hstate *h, struct page *page, int nid) { __prep_new_huge_page(h, page); - spin_lock(&hugetlb_lock); + spin_lock_irq(&hugetlb_lock); __prep_account_new_huge_page(h, nid); ClearHPageFreed(page); - spin_unlock(&hugetlb_lock); + spin_unlock_irq(&hugetlb_lock); } static void prep_compound_gigantic_page(struct page *page, unsigned int order) @@ -5909,7 +5909,7 @@ bool isolate_huge_page(struct page *page, struct list_head *list) ClearHPageMigratable(page); list_move_tail(&page->lru, list); unlock: - spin_unlock(&hugetlb_lock); + spin_unlock_irq(&hugetlb_lock); return ret; } -- Gitee