Skip to content

RFC Enable THP migration for all possible architectures

Zi Yan linux-arm-kernel linux-mips linux-mm linux-s390 linux-snps-arc linuxppc-dev lkml sparclinux 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest9 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9arc: mm: migrate: add pmd swap entry to support thp migration.arch/arc/include/asm/pgtable.h+2 -00 replies
2/9arm: mm: migrate: add pmd swap entry to support thp migration.arch/arm/include/asm/pgtable.h+2 -00 replies
3/9arm64: mm: migrate: add pmd swap entry to support thp migration.arch/arm64/include/asm/pgtable.h+2 -00 replies
4/9i386: mm: migrate: add pmd swap entry to support thp migration.arch/x86/include/asm/pgtable-2level.h arch/x86/include/asm/pgtable-3level.h+4 -00 replies
5/9mips: mm: migrate: add pmd swap entry to support thp migration.arch/mips/include/asm/pgtable-64.h+2 -00 replies
6/9powerpc: mm: migrate: add pmd swap entry to support thp migration.arch/powerpc/include/asm/book3s/32/pgtable.h arch/powerpc/include/asm/book3s/64/pgtable.h arch/powerpc/include/asm/nohash/32/pgtable.h +1 more+23 -00 replies
7/9s390: mm: migrate: add pmd swap entry to support thp migration.arch/s390/include/asm/pgtable.h+5 -00 replies
8/9sparc: mm: migrate: add pmd swap entry to support thp migration.arch/sparc/include/asm/pgtable_32.h arch/sparc/include/asm/pgtable_64.h+4 -00 replies
9/9mm: migrate: enable thp migration for all possible architectures.arch/x86/Kconfig arch/x86/include/asm/pgtable.h fs/proc/task_mmu.c +7 more+29 -540 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/9] Enable THP migration for all possible architectures

From: Zi Yan <[email protected]>

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-mm at kvack.org
Cc Vineet Gupta <[email protected]>
Cc linux-snps-arc at lists.infradead.org
Cc Russell King <[email protected]>
Cc Christoffer Dall <[email protected]>
Cc Marc Zyngier <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc Catalin Marinas <[email protected]>
Cc Will Deacon <[email protected]>
Cc Steve Capper <[email protected]>
Cc Kristina Martsenko <[email protected]>
Cc Dan Williams <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "Kirill A. Shutemov" <[email protected]>
Cc x86 at kernel.org
Cc Ralf Baechle <[email protected]>
Cc James Hogan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc linux-mips at linux-mips.org
Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc "Aneesh Kumar K.V" <[email protected]>
Cc Ram Pai <[email protected]>
Cc Balbir Singh <[email protected]>
Cc Naoya Horiguchi <[email protected]>
Cc linuxppc-dev at lists.ozlabs.org
Cc Martin Schwidefsky <[email protected]>
Cc Heiko Carstens <[email protected]>
Cc Janosch Frank <[email protected]>
Cc linux-s390 at vger.kernel.org
Cc "David S. Miller" <[email protected]>
Cc sparclinux at vger.kernel.org
Cc "Huang, Ying" <[email protected]>

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(-)
Signature · 1 line
2.17.0