thp: merge page pre-alloc in khugepaged_loop into khugepaged_do_scan
commitd516904bd239fe2c9f1bd46cf146bb4b8831321c
authorXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Mon, 8 Oct 2012 23:29:48 +0000 (8 16:29 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 9 Oct 2012 07:22:26 +0000 (9 16:22 +0900)
treede3ec1af9c309dba0faf2e662ba49f651a566e82
parent9817626e722a5e5699cf38f5d3a4c9851e054436
thp: merge page pre-alloc in khugepaged_loop into khugepaged_do_scan

There are two pre-alloc operations in these two function, the different is:
- it allows to sleep if page alloc fail in khugepaged_loop
- it exits immediately if page alloc fail in khugepaged_do_scan

Actually, in khugepaged_do_scan, we can allow the pre-alloc to sleep on
the first failure, then the operation in khugepaged_loop can be removed

Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/huge_memory.c