mm, hugetlb: schedule when potentially allocating many hugepages
authorDavid Rientjes <[email protected]>
Mon, 10 Jul 2017 22:48:50 +0000 (15:48 -0700)
committerLinus Torvalds <[email protected]>
Mon, 10 Jul 2017 23:32:31 +0000 (16:32 -0700)
commit69ed779a1454d9a57ba3738135eec9be550e0613
treefdb48ca5122fcbbd4fbe42910a44d0341d22467f
parent8b9132388964df2cfe151a88fd1dd8219dabf23c
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."

Link: http://lkml.kernel.org/r/[email protected]
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]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/hugetlb.c