[RFC PATCH 0/2] restore large page mappings in direct map for secretmem
From: Lance Yang
Date: Wed Jun 03 2026 - 06:47:17 EST
Hi all,
secretmem removes the pages backing secretmem mappings from the direct map.
Removing one base page from the direct map can split the covering large
mapping down to PTE mappings. Repeated splits can leave more of the direct
map mapped with PTEs, meaning more TLB entries for the same range and
potentially more TLB pressure.
This series adds an arch hook so secretmem can ask the architecture to try
to restore large page mappings whenever secretmem restores a folio to the
direct map.
Thanks,
Lance
Lance Yang (2):
mm/secretmem: try to restore large page mappings in direct map
x86/mm: restore large page mappings for secretmem
arch/x86/include/asm/set_memory.h | 2 ++
arch/x86/mm/pat/set_memory.c | 27 +++++++++++++++++++++++++++
include/linux/set_memory.h | 6 ++++++
mm/secretmem.c | 12 ++++++++++--
4 files changed, 45 insertions(+), 2 deletions(-)
--
2.49.0