Skip to content

mm, swap: Enable THP SWAP for PowerPC Book3S64

Ritesh Harjani (IBM) linux-mm linuxppc-dev lkml 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 13 repliesIn review
  2. v33 patches 2 repliesSuperseded
  3. v2 posting 2/23 patches 1 replySuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v2 posting 1/21 patch3 repliesApplied 1/1
v1 RFC4 patches6 repliesSuperseded

Changes in v4 from the cover letter

======
1. Revert SWAPFILE_CLUSTER definition - since we already adjusted all the users of SWAPFILE_CLUSTER and made those users use this value at runtime (Kairui Song)

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3mm, swap: make SWAPFILE_CLUSTER runtimemm/swap_table.h mm/swapfile.c+14 -93 replies
2/3mm, swap: allow archs to override SWAP_NR_ORDERS via ARCH_MAX_PMD_ORDERarch/powerpc/include/asm/book3s/64/pgtable.h include/linux/swap.h+18 -16 replies
3/3powerpc: Kconfig: Enable THP_SWAP on Book3S64arch/powerpc/platforms/Kconfig.cputype+1 -04 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchSayali PatilBarry Song
1/3R-b
2/3R-b
3/3T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/3] mm, swap: Enable THP SWAP for PowerPC Book3S64

On PowerPC Book3S64, MMU is selected at runtime, so macros like PMD_SHIFT are effectively runtime variables in the Book3S64 code. THP swap code uses these macros for e.g. to size some of its array data structures based on PMD_ORDER. This patch series makes that usage dependent on the runtime variable and provides an upper-bound architecture override for cases (e.g. SWAP_NR_ORDERS), where the runtime conversion is not considered beneficial.

This series increases bandwidth throughput with zram backend for swapout by around 40-50% with Radix and 100-130% with Hash (Tested by Sayali)

Note that this patch series is based out of linux-next (next-20260608).

v3->v4:
======
1. Revert SWAPFILE_CLUSTER definition - since we already adjusted all the users of SWAPFILE_CLUSTER and made those users use this value at runtime (Kairui Song)

v2 -> v3:
=========
1. Fixed sparse warning for swap_table_use_page reported by lkp in patch-1

RFC -> v2:
==========
1. Send the unused leftovers change in swap.h separately [1]
2. Changed RFC Patch-3 design from runtime SWAP_NR_ORDERS to arch override (ARCH_MAX_PMD_ORDER) - suggested by Youngjun
3. Dropped RFC tag

[1]: https://lore.kernel.org/linux-mm/68591daf0d679e5a0072d63751f187d14613e2b0.1781146877.git.ritesh.list@gmail.com/
[RFC]: https://lore.kernel.org/linux-mm/[email protected]/
[v2]: https://lore.kernel.org/linuxppc-dev/[email protected]/

Ritesh Harjani (IBM) (3):
mm, swap: make SWAPFILE_CLUSTER runtime
mm, swap: allow archs to override SWAP_NR_ORDERS via ARCH_MAX_PMD_ORDER
powerpc: Kconfig: Enable THP_SWAP on Book3S64

 arch/powerpc/include/asm/book3s/64/pgtable.h |  7 +++++++
 arch/powerpc/platforms/Kconfig.cputype       |  1 +
 include/linux/swap.h                         | 12 +++++++++++-
 mm/swap_table.h                              |  6 ++----
 mm/swapfile.c                                | 17 ++++++++++++-----
 5 files changed, 33 insertions(+), 10 deletions(-)

--
2.39.5