mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 02:53:36 +02:00
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>
This commit is contained in:
parent
412d000346
commit
0189429567
|
|
@ -3046,6 +3046,13 @@ static inline struct ptdesc *pagetable_alloc_noprof(gfp_t gfp, unsigned int orde
|
|||
}
|
||||
#define pagetable_alloc(...) alloc_hooks(pagetable_alloc_noprof(__VA_ARGS__))
|
||||
|
||||
static inline void __pagetable_free(struct ptdesc *pt)
|
||||
{
|
||||
struct page *page = ptdesc_page(pt);
|
||||
|
||||
__free_pages(page, compound_order(page));
|
||||
}
|
||||
|
||||
/**
|
||||
* pagetable_free - Free pagetables
|
||||
* @pt: The page table descriptor
|
||||
|
|
@ -3055,12 +3062,10 @@ static inline struct ptdesc *pagetable_alloc_noprof(gfp_t gfp, unsigned int orde
|
|||
*/
|
||||
static inline void pagetable_free(struct ptdesc *pt)
|
||||
{
|
||||
struct page *page = ptdesc_page(pt);
|
||||
|
||||
if (ptdesc_test_kernel(pt))
|
||||
ptdesc_clear_kernel(pt);
|
||||
|
||||
__free_pages(page, compound_order(page));
|
||||
__pagetable_free(pt);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_SPLIT_PTE_PTLOCKS)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user