s390-add-pte_free_defer-for-pgtables-sharing-page.patch removed from -mm tree
The quilt patch titled
Subject: s390: add pte_free_defer() for pgtables sharing page
has been removed from the -mm tree. Its filename was
s390-add-pte_free_defer-for-pgtables-sharing-page.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: Hugh Dickins <[email protected]>
Subject: s390: add pte_free_defer() for pgtables sharing page
Date: Tue, 11 Jul 2023 21:38:35 -0700 (PDT)
Add s390-specific pte_free_defer(), to free table page via call_rcu(). pte_free_defer() will be called inside khugepaged's retract_page_tables() loop, where allocating extra memory cannot be relied upon. This precedes the generic version to avoid build breakage from incompatible pgtable_t.
This version is more complicated than others: because s390 fits two 2K page tables into one 4K page (so page->rcu_head must be shared between both halves), and already uses page->lru (which page->rcu_head overlays) to list any free halves; with clever management by page->_refcount bits.
Build upon the existing management, adjusted to follow a new rule: that a page is never on the free list if pte_free_defer() was used on either half (marked by PageActive). And for simplicity, delay calling RCU until both halves are freed.
Not adding back unallocated fragments to the list in pte_free_defer() can result in wasting some amount of memory for pagetables, depending on how long the allocated fragment will stay in use. In practice, this effect is expected to be insignificant, and not justify a far more complex approach, which might allow to add the fragments back later in __tlb_remove_table(), where we might not have a stable mm any more.
---
arch/s390/include/asm/pgalloc.h | 4 + arch/s390/mm/pgalloc.c | 80 +++++++++++++++++++++++++----- 2 files changed, 72 insertions(+), 12 deletions(-)
arch/s390/include/asm/pgalloc.h renamed from arch/s390/include/asm/pgalloc.h~s390-add-pte_free_defer-for-pgtables-sharing-page +4 -0
@@ -143,6 +143,10 @@ static inline void pmd_populate(struct m#define pte_free_kernel (mm, pte) page_table_free(mm, (unsigned long *) pte)#define pte_free (mm, pte) page_table_free(mm, (unsigned long *) pte) +/* arch use pte_free_defer() implementation in arch/s390/mm/pgalloc.c */ +#define pte_free_defer pte_free_defer +void pte_free_defer (struct mm_struct *mm,pgtable_t pgtable); +void vmem_map_init (void );void *vmem_crst_alloc (unsigned long val);pte_t *vmem_pte_alloc (void );
arch/s390/mm/pgalloc.c renamed from arch/s390/mm/pgalloc.c~s390-add-pte_free_defer-for-pgtables-sharing-page +68 -12
137 lines not on this page · raw message
_
Patches currently in -mm which might be from [email protected] are