mm: thp: make transhuge_vma_suitable available for anonymous THP
transhuge_vma_suitable() was only available for shmem THP, but anonymous
THP has the same check except pgoff check. And, it will be used for THP
eligible check in the later patch, so make it available for all kind of
THPs. This also helps reduce code duplication slightly.
Since anonymous THP doesn't have to check pgoff, so make pgoff check
shmem vma only.
And regroup some functions in include/linux/mm.h to solve compile issue
since transhuge_vma_suitable() needs call vma_is_anonymous() which was
defined after huge_mm.h is included.
[email@example.com: fix typo]
Signed-off-by: Yang Shi <firstname.lastname@example.org>
Acked-by: Hugh Dickins <email@example.com>
Cc: Kirill A. Shutemov <firstname.lastname@example.org>
Cc: Michal Hocko <email@example.com>
Cc: Vlastimil Babka <firstname.lastname@example.org>
Cc: David Rientjes <email@example.com>
Cc: Andrea Arcangeli <firstname.lastname@example.org>
Signed-off-by: Andrew Morton <email@example.com>
Signed-off-by: Linus Torvalds <firstname.lastname@example.org>
4 files changed