aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Liu <lliubbo@gmail.com>2013-11-12 18:07:35 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-12 22:09:06 -0500
commit10dc4155c7714f508fe2e4667164925ea971fb25 (patch)
tree4bd636f0313e07037770a960fbccbf5198c8f677
parent0151e3d6d9d72df8f823c3f991a14ba63fb13f28 (diff)
mm: thp: cleanup: mv alloc_hugepage to better place
Move alloc_hugepage() to a better place, no need for a seperate #ifndef CONFIG_NUMA Signed-off-by: Bob Liu <bob.liu@oracle.com> Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Mel Gorman <mel@csn.ul.ie> Cc: Andrew Davidoff <davidoff@qedmf.net> Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/huge_memory.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 4f7e2113646c..411c4f2c0492 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -759,14 +759,6 @@ static inline struct page *alloc_hugepage_vma(int defrag,
759 HPAGE_PMD_ORDER, vma, haddr, nd); 759 HPAGE_PMD_ORDER, vma, haddr, nd);
760} 760}
761 761
762#ifndef CONFIG_NUMA
763static inline struct page *alloc_hugepage(int defrag)
764{
765 return alloc_pages(alloc_hugepage_gfpmask(defrag, 0),
766 HPAGE_PMD_ORDER);
767}
768#endif
769
770static bool set_huge_zero_page(pgtable_t pgtable, struct mm_struct *mm, 762static bool set_huge_zero_page(pgtable_t pgtable, struct mm_struct *mm,
771 struct vm_area_struct *vma, unsigned long haddr, pmd_t *pmd, 763 struct vm_area_struct *vma, unsigned long haddr, pmd_t *pmd,
772 struct page *zero_page) 764 struct page *zero_page)
@@ -2251,6 +2243,12 @@ static struct page
2251 return *hpage; 2243 return *hpage;
2252} 2244}
2253#else 2245#else
2246static inline struct page *alloc_hugepage(int defrag)
2247{
2248 return alloc_pages(alloc_hugepage_gfpmask(defrag, 0),
2249 HPAGE_PMD_ORDER);
2250}
2251
2254static struct page *khugepaged_alloc_hugepage(bool *wait) 2252static struct page *khugepaged_alloc_hugepage(bool *wait)
2255{ 2253{
2256 struct page *hpage; 2254 struct page *hpage;