Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: introduce pure page table freeing function

The pages used for ptdescs are currently freed back to the allocator in a
single location. They will shortly be freed from a second location.

Create a simple helper that just frees them back to the allocator.

Link: https://lkml.kernel.org/r/20251022082635.2462433-6-baolu.lu@linux.intel.com
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: David Hildenbrand <david@redhat.com>
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Betkov <bp@alien8.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jann Horn <jannh@google.com>
Cc: Jean-Philippe Brucker <jean-philippe@linaro.org>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Robin Murohy <robin.murphy@arm.com>
Cc: Thomas Gleinxer <tglx@linutronix.de>
Cc: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
Cc: Vasant Hegde <vasant.hegde@amd.com>
Cc: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Will Deacon <will@kernel.org>
Cc: Yi Lai <yi1.lai@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Dave Hansen and committed by
Andrew Morton
01894295 412d0003

+8 -3
+8 -3
include/linux/mm.h
··· 3046 3046 } 3047 3047 #define pagetable_alloc(...) alloc_hooks(pagetable_alloc_noprof(__VA_ARGS__)) 3048 3048 3049 + static inline void __pagetable_free(struct ptdesc *pt) 3050 + { 3051 + struct page *page = ptdesc_page(pt); 3052 + 3053 + __free_pages(page, compound_order(page)); 3054 + } 3055 + 3049 3056 /** 3050 3057 * pagetable_free - Free pagetables 3051 3058 * @pt: The page table descriptor ··· 3062 3055 */ 3063 3056 static inline void pagetable_free(struct ptdesc *pt) 3064 3057 { 3065 - struct page *page = ptdesc_page(pt); 3066 - 3067 3058 if (ptdesc_test_kernel(pt)) 3068 3059 ptdesc_clear_kernel(pt); 3069 3060 3070 - __free_pages(page, compound_order(page)); 3061 + __pagetable_free(pt); 3071 3062 } 3072 3063 3073 3064 #if defined(CONFIG_SPLIT_PTE_PTLOCKS)