From: Mizuma, Masayoshi Date: Fri, 18 Apr 2014 22:07:18 +0000 (-0700) Subject: mm/hugetlb.c: add cond_resched_lock() in return_unused_surplus_pages() X-Git-Tag: v3.12.21~70 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4921f0b2e1fc49c368d6fd43bff5bdbd1e48dbb3;p=thirdparty%2Fkernel%2Fstable.git mm/hugetlb.c: add cond_resched_lock() in return_unused_surplus_pages() commit 7848a4bf51b34f41fcc9bd77e837126d99ae84e3 upstream. soft lockup in freeing gigantic hugepage fixed in commit 55f67141a892 "mm: hugetlb: fix softlockup when a large number of hugepages are freed." can happen in return_unused_surplus_pages(), so let's fix it. Signed-off-by: Masayoshi Mizuma Signed-off-by: Naoya Horiguchi Cc: Joonsoo Kim Cc: Michal Hocko Cc: Aneesh Kumar Cc: KOSAKI Motohiro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Jiri Slaby --- diff --git a/mm/hugetlb.c b/mm/hugetlb.c index efbb9dc67f2f5..92e103b72dcbe 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1177,6 +1177,7 @@ static void return_unused_surplus_pages(struct hstate *h, while (nr_pages--) { if (!free_pool_huge_page(h, &node_states[N_MEMORY], 1)) break; + cond_resched_lock(&hugetlb_lock); } }