mm: thp: kill transparent_hugepage_active()
authorYang Shi <shy828301@gmail.com>
Thu, 16 Jun 2022 17:48:37 +0000 (10:48 -0700)
committerakpm <akpm@linux-foundation.org>
Mon, 18 Jul 2022 00:14:33 +0000 (17:14 -0700)
commit9fec51689ff60d9766b38051a0b1692f93d95364
tree3a49d1f60fa549d41904e4be210d351391d56502
parentf707fa493784b515ced01d4e261afe16fc784b5d
mm: thp: kill transparent_hugepage_active()

The transparent_hugepage_active() was introduced to show THP eligibility
bit in smaps in proc, smaps is the only user.  But it actually does the
similar check as hugepage_vma_check() which is used by khugepaged.  We
definitely don't have to maintain two similar checks, so kill
transparent_hugepage_active().

This patch also fixed the wrong behavior for VM_NO_KHUGEPAGED vmas.

Also move hugepage_vma_check() to huge_memory.c and huge_mm.h since it
is not only for khugepaged anymore.

[akpm@linux-foundation.org: check vma->vm_mm, per Zach]
[akpm@linux-foundation.org: add comment to vdso check]
Link: https://lkml.kernel.org/r/20220616174840.1202070-5-shy828301@gmail.com
Signed-off-by: Yang Shi <shy828301@gmail.com>
Reviewed-by: Zach O'Keefe <zokeefe@google.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/proc/task_mmu.c
include/linux/huge_mm.h
include/linux/khugepaged.h
mm/huge_memory.c
mm/khugepaged.c