diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 01c11ceb47d6c0c713d9a49bbbb9706e5430e383..176e0318960f93e724280ee37ea1e1b3a66b3e9d 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1781,6 +1781,7 @@ static int gather_surplus_pages(struct hstate *h, int delta) break; } list_add(&page->lru, &surplus_list); + cond_resched(); } allocated += i; @@ -2249,6 +2250,7 @@ static void __init hugetlb_hstate_alloc_pages(struct hstate *h) } else if (!alloc_fresh_huge_page(h, &node_states[N_MEMORY])) break; + cond_resched(); } if (i < h->max_huge_pages) { char buf[32];