mm-huge_memory-add-device-private-thp-support-to-pmd-operations.patch removed from -mm tree
The quilt patch titled
Subject: mm/huge_memory: add device-private THP support to PMD operations
has been removed from the -mm tree. Its filename was
mm-huge_memory-add-device-private-thp-support-to-pmd-operations.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Balbir Singh <[email protected]>
Subject: mm/huge_memory: add device-private THP support to PMD operations
Date: Wed, 1 Oct 2025 16:56:54 +1000
Extend core huge page management functions to handle device-private THP entries. This enables proper handling of large device-private folios in fundamental MM operations.
The following functions have been updated:
- copy_huge_pmd(): Handle device-private entries during fork/clone
- zap_huge_pmd(): Properly free device-private THP during munmap
- change_huge_pmd(): Support protection changes on device-private THP
- __pte_offset_map(): Add device-private entry awareness
---
include/linux/swapops.h | 32 +++++++++++++++++++++ mm/huge_memory.c | 56 +++++++++++++++++++++++++++++++------- mm/pgtable-generic.c | 2 - 3 files changed, 80 insertions(+), 10 deletions(-)
include/linux/swapops.h renamed from include/linux/swapops.h~mm-huge_memory-add-device-private-thp-support-to-pmd-operations +32 -0
@@ -594,10 +594,42 @@ static inline int is_pmd_migration_entry }#endif /* CONFIG_ARCH_ENABLE_THP_MIGRATION */ +#if defined(CONFIG_ZONE_DEVICE ) && defined(CONFIG_ARCH_ENABLE_THP_MIGRATION ) + +/** +* is_pmd_device_private_entry() - Check if PMD contains a device private swap entry +* @pmd: The PMD to check +* +* Returns true if the PMD contains a swap entry that represents a device private +* page mapping. This is used for zone device private pages that have been +* swapped out but still need special handling during various memory management +* operations. +* +* Return: 1 if PMD contains device private entry, 0 otherwise +*/ +static inline int is_pmd_device_private_entry (pmd_t pmd) +{ +return is_swap_pmd (pmd) &&is_device_private_entry (pmd_to_swp_entry (pmd)); +} + +#else /* CONFIG_ZONE_DEVICE && CONFIG_ARCH_ENABLE_THP_MIGRATION */ + +static inline int is_pmd_device_private_entry (pmd_t pmd) +{ +return 0 ; +} + +#endif /* CONFIG_ZONE_DEVICE && CONFIG_ARCH_ENABLE_THP_MIGRATION */ +static inline int non_swap_entry (swp_entry_t entry) {return swp_type (entry) >=MAX_SWAPFILES ; } +static inline int is_pmd_non_present_folio_entry (pmd_t pmd) +{ +return is_pmd_migration_entry (pmd) ||is_pmd_device_private_entry (pmd); +} +#endif /* CONFIG_MMU */ #endif /* _LINUX_SWAPOPS_H */
mm/huge_memory.c renamed from mm/huge_memory.c~mm-huge_memory-add-device-private-thp-support-to-pmd-operations +47 -9
98 lines not on this page · raw message
mm/pgtable-generic.c renamed from mm/pgtable-generic.c~mm-huge_memory-add-device-private-thp-support-to-pmd-operations +1 -1
@@ -292,7 +292,7 @@ pte_t *___pte_offset_map(pmd_t *pmd, unsif (pmdvalp) *pmdvalp = pmdval; -if (unlikely (pmd_none (pmdval) ||is_pmd_migration_entry (pmdval))) +if (unlikely (pmd_none (pmdval) || !pmd_present (pmdval))) goto nomap;if (unlikely (pmd_trans_huge (pmdval))) goto nomap;
_
Patches currently in -mm which might be from [email protected] are