Skip to content

Commit 10dc415

Browse files
aet00torvalds
authored andcommitted
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 <[email protected]> Reviewed-by: Yasuaki Ishimatsu <[email protected]> Acked-by: Kirill A. Shutemov <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Andrew Davidoff <[email protected]> Cc: Wanpeng Li <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 0151e3d commit 10dc415

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

mm/huge_memory.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -759,14 +759,6 @@ static inline struct page *alloc_hugepage_vma(int defrag,
759759
HPAGE_PMD_ORDER, vma, haddr, nd);
760760
}
761761

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-
770762
static bool set_huge_zero_page(pgtable_t pgtable, struct mm_struct *mm,
771763
struct vm_area_struct *vma, unsigned long haddr, pmd_t *pmd,
772764
struct page *zero_page)
@@ -2251,6 +2243,12 @@ static struct page
22512243
return *hpage;
22522244
}
22532245
#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+
22542252
static struct page *khugepaged_alloc_hugepage(bool *wait)
22552253
{
22562254
struct page *hpage;

0 commit comments

Comments
 (0)