From: Zi Yan <zi....@cs.rutgers.edu> Hi all,
THP migration is only enabled on x86_64 with a special ARCH_ENABLE_THP_MIGRATION macro. This patchset enables THP migration for all architectures that uses transparent hugepage, so that special macro can be dropped. Instead, THP migration is enabled/disabled via /sys/kernel/mm/transparent_hugepage/enable_thp_migration. I grepped for TRANSPARENT_HUGEPAGE in arch folder and got 9 architectures that are supporting transparent hugepage. I mechanically add __pmd_to_swp_entry() and __swp_entry_to_pmd() based on existing __pte_to_swp_entry() and __swp_entry_to_pte() for all these architectures, except tile which is going to be dropped. I have successfully compiled all these architectures, but have NOT tested them due to lack of real hardware. I appreciate your help, if the maintainers of these architectures can do a quick test with the code from https://github.com/x-y-z/thp-migration-bench . Please apply patch 9 as well to enable THP migration. By enabling THP migration, migrating a 2MB THP on x86_64 machines takes only 1/3 time of migrating equivalent 512 4KB pages. Hi Naoya, I also add soft dirty support for powerpc and s390. It would be great if you can take a look at patch 6 & 7. Feel free to give comments. Thanks. Cc: linux...@kvack.org Cc: Vineet Gupta <vgu...@synopsys.com> Cc: linux-snps-arc@lists.infradead.org Cc: Russell King <li...@armlinux.org.uk> Cc: Christoffer Dall <christoffer.d...@linaro.org> Cc: Marc Zyngier <marc.zyng...@arm.com> Cc: linux-arm-ker...@lists.infradead.org Cc: Catalin Marinas <catalin.mari...@arm.com> Cc: Will Deacon <will.dea...@arm.com> Cc: Steve Capper <steve.cap...@arm.com> Cc: Kristina Martsenko <kristina.martse...@arm.com> Cc: Dan Williams <dan.j.willi...@intel.com> Cc: Thomas Gleixner <t...@linutronix.de> Cc: Ingo Molnar <mi...@redhat.com> Cc: "Kirill A. Shutemov" <kirill.shute...@linux.intel.com> Cc: x...@kernel.org Cc: Ralf Baechle <r...@linux-mips.org> Cc: James Hogan <jho...@kernel.org> Cc: Michal Hocko <mho...@suse.com> Cc: linux-m...@linux-mips.org Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org> Cc: Paul Mackerras <pau...@samba.org> Cc: Michael Ellerman <m...@ellerman.id.au> Cc: "Aneesh Kumar K.V" <aneesh.ku...@linux.vnet.ibm.com> Cc: Ram Pai <linux...@us.ibm.com> Cc: Balbir Singh <bsinghar...@gmail.com> Cc: Naoya Horiguchi <n-horigu...@ah.jp.nec.com> Cc: linuxppc-...@lists.ozlabs.org Cc: Martin Schwidefsky <schwidef...@de.ibm.com> Cc: Heiko Carstens <heiko.carst...@de.ibm.com> Cc: Janosch Frank <fran...@linux.vnet.ibm.com> Cc: linux-s...@vger.kernel.org Cc: "David S. Miller" <da...@davemloft.net> Cc: sparcli...@vger.kernel.org Cc: "Huang, Ying" <ying.hu...@intel.com> Zi Yan (9): arc: mm: migrate: add pmd swap entry to support thp migration. arm: mm: migrate: add pmd swap entry to support thp migration. arm64: mm: migrate: add pmd swap entry to support thp migration. i386: mm: migrate: add pmd swap entry to support thp migration. mips: mm: migrate: add pmd swap entry to support thp migration. powerpc: mm: migrate: add pmd swap entry to support thp migration. s390: mm: migrate: add pmd swap entry to support thp migration. sparc: mm: migrate: add pmd swap entry to support thp migration. mm: migrate: enable thp migration for all possible architectures. arch/arc/include/asm/pgtable.h | 2 ++ arch/arm/include/asm/pgtable.h | 2 ++ arch/arm64/include/asm/pgtable.h | 2 ++ arch/mips/include/asm/pgtable-64.h | 2 ++ arch/powerpc/include/asm/book3s/32/pgtable.h | 2 ++ arch/powerpc/include/asm/book3s/64/pgtable.h | 17 ++++++++++++ arch/powerpc/include/asm/nohash/32/pgtable.h | 2 ++ arch/powerpc/include/asm/nohash/64/pgtable.h | 2 ++ arch/s390/include/asm/pgtable.h | 5 ++++ arch/sparc/include/asm/pgtable_32.h | 2 ++ arch/sparc/include/asm/pgtable_64.h | 2 ++ arch/x86/Kconfig | 4 --- arch/x86/include/asm/pgtable-2level.h | 2 ++ arch/x86/include/asm/pgtable-3level.h | 2 ++ arch/x86/include/asm/pgtable.h | 2 -- fs/proc/task_mmu.c | 2 -- include/asm-generic/pgtable.h | 21 ++------------- include/linux/huge_mm.h | 9 +++---- include/linux/swapops.h | 4 +-- mm/Kconfig | 3 --- mm/huge_memory.c | 27 +++++++++++++------- mm/migrate.c | 6 ++--- mm/rmap.c | 5 ++-- 23 files changed, 73 insertions(+), 54 deletions(-) -- 2.17.0 _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc