Commit 10dc4155c7714f508fe2e4667164925ea971fb25

Authored by Bob Liu
Committed by Linus Torvalds
1 parent 0151e3d6d9

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>

Showing 1 changed file with 6 additions and 8 deletions Side-by-side Diff

... ... @@ -759,14 +759,6 @@
759 759 HPAGE_PMD_ORDER, vma, haddr, nd);
760 760 }
761 761  
762   -#ifndef CONFIG_NUMA
763   -static 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   -
770 762 static bool set_huge_zero_page(pgtable_t pgtable, struct mm_struct *mm,
771 763 struct vm_area_struct *vma, unsigned long haddr, pmd_t *pmd,
772 764 struct page *zero_page)
... ... @@ -2251,6 +2243,12 @@
2251 2243 return *hpage;
2252 2244 }
2253 2245 #else
  2246 +static inline struct page *alloc_hugepage(int defrag)
  2247 +{
  2248 + return alloc_pages(alloc_hugepage_gfpmask(defrag, 0),
  2249 + HPAGE_PMD_ORDER);
  2250 +}
  2251 +
2254 2252 static struct page *khugepaged_alloc_hugepage(bool *wait)
2255 2253 {
2256 2254 struct page *hpage;