Re: [PATCH v4 1/3] mm, swap: make SWAPFILE_CLUSTER runtime

From: Barry Song

Date: Tue Jun 23 2026 - 04:44:46 EST


On Fri, Jun 19, 2026 at 12:41 PM Ritesh Harjani (IBM)
<ritesh.list@xxxxxxxxx> wrote:
>
> 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 to size some of its array data structures
> based on PMD_ORDER e.g. SWAPFILE_CLUSTER macro is used for this very
> purpose.
> Hence this patch makes the users of SWAPFILE_CLUSTER to use this macro value at
> runtime and also modifies swap_table and swap_memcg_table which were earlier
> using this macro for defining the number of table entries.
>
> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@xxxxxxxxx>
> ---

Reviewed-by: Barry Song <baohua@xxxxxxxxxx>