Re: [PATCH v8 mm-new 05/12] mm: thp: decouple THP allocation between swap and page fault paths

From: Usama Arif

Date: Fri Sep 26 2025 - 11:19:45 EST




On 26/09/2025 10:33, Yafang Shao wrote:
> The new BPF capability enables finer-grained THP policy decisions by
> introducing separate handling for swap faults versus normal page faults.
>
> As highlighted by Barry:
>
> We’ve observed that swapping in large folios can lead to more
> swap thrashing for some workloads- e.g. kernel build. Consequently,
> some workloads might prefer swapping in smaller folios than those
> allocated by alloc_anon_folio().
>
> While prtcl() could potentially be extended to leverage this new policy,
> doing so would require modifications to the uAPI.
>
> Signed-off-by: Yafang Shao <laoar.shao@xxxxxxxxx>
> Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx>
> Cc: Barry Song <21cnbao@xxxxxxxxx>
> ---
> include/linux/huge_mm.h | 3 ++-
> mm/huge_memory.c | 2 +-
> mm/memory.c | 2 +-
> 3 files changed, 4 insertions(+), 3 deletions(-)
>

Acked-by: Usama Arif <usamaarif642@xxxxxxxxx>