diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 549bf5ac3d6e0..7a57e302338fa 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1675,6 +1675,10 @@ static unsigned long set_max_huge_pages(struct hstate *h, unsigned long count, * and reducing the surplus. */ spin_unlock(&hugetlb_lock); + + /* yield cpu to avoid soft lockup */ + cond_resched(); + if (hstate_is_gigantic(h)) ret = alloc_fresh_gigantic_page(h, nodes_allowed); else