mm, hugetlb: schedule when potentially allocating many hugepages
Subsystems (2)
[email protected]
maintainerPATCH 33/115 mm, hugetlb: schedule when potentially allocating many hugepages
From: David Rientjes <[email protected]>
Subject: mm, hugetlb: schedule when potentially allocating many hugepages
A few hugetlb allocators loop while calling the page allocator and can potentially prevent rescheduling if the page allocator slowpath is not utilized.
Conditionally schedule when large numbers of hugepages can be allocated.
Anshuman: "Fixes a task which was getting hung while writing like 10000 hugepages (16MB on POWER8) into /proc/sys/vm/nr_hugepages."
Signed-off-by David Rientjes <[email protected]>
Reviewed-by Mike Kravetz <[email protected]>
Tested-by Anshuman Khandual <[email protected]>
Cc Naoya Horiguchi <[email protected]>
Cc "Aneesh Kumar K.V" <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
mm/hugetlb.c | 2 ++ 1 file changed, 2 insertions(+)
mm/hugetlb.c renamed from mm/hugetlb.c~mm-hugetlb-schedule-when-potentially-allocating-many-hugepages +2 -0
@@ -1781,6 +1781,7 @@ retry:break ; }list_add (&page->lru, &surplus_list); +cond_resched (); } allocated += i;
@@ -2249,6 +2250,7 @@ static void __init hugetlb_hstate_alloc_ }else if (!alloc_fresh_huge_page (h, &node_states[N_MEMORY ]))break ; +cond_resched (); }if (i < h->max_huge_pages) {char buf[32 ];
_