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.

s390: pgtable: add statistics for PUD and P4D level page table

Like PMD and PTE level page table, also add statistics for PUD and P4D
page table.

Link: https://lkml.kernel.org/r/4707dffce228ccec5c6662810566dd12b5741c4b.1736317725.git.zhengqi.arch@bytedance.com
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Suggested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com>
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Alexandre Ghiti <alex@ghiti.fr>
Cc: Alexandre Ghiti <alexghiti@rivosinc.com>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: Aneesh Kumar K.V (Arm) <aneesh.kumar@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jann Horn <jannh@google.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Cc: Will Deacon <will@kernel.org>
Cc: Yu Zhao <yuzhao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Qi Zheng and committed by
Andrew Morton
b7dcd539 440af48d

+23 -8
+21 -8
arch/s390/include/asm/pgalloc.h
··· 53 53 { 54 54 unsigned long *table = crst_table_alloc(mm); 55 55 56 - if (table) 57 - crst_table_init(table, _REGION2_ENTRY_EMPTY); 56 + if (!table) 57 + return NULL; 58 + crst_table_init(table, _REGION2_ENTRY_EMPTY); 59 + pagetable_p4d_ctor(virt_to_ptdesc(table)); 60 + 58 61 return (p4d_t *) table; 59 62 } 60 63 61 64 static inline void p4d_free(struct mm_struct *mm, p4d_t *p4d) 62 65 { 63 - if (!mm_p4d_folded(mm)) 64 - crst_table_free(mm, (unsigned long *) p4d); 66 + if (mm_p4d_folded(mm)) 67 + return; 68 + 69 + pagetable_p4d_dtor(virt_to_ptdesc(p4d)); 70 + crst_table_free(mm, (unsigned long *) p4d); 65 71 } 66 72 67 73 static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long address) 68 74 { 69 75 unsigned long *table = crst_table_alloc(mm); 70 - if (table) 71 - crst_table_init(table, _REGION3_ENTRY_EMPTY); 76 + 77 + if (!table) 78 + return NULL; 79 + crst_table_init(table, _REGION3_ENTRY_EMPTY); 80 + pagetable_pud_ctor(virt_to_ptdesc(table)); 81 + 72 82 return (pud_t *) table; 73 83 } 74 84 75 85 static inline void pud_free(struct mm_struct *mm, pud_t *pud) 76 86 { 77 - if (!mm_pud_folded(mm)) 78 - crst_table_free(mm, (unsigned long *) pud); 87 + if (mm_pud_folded(mm)) 88 + return; 89 + 90 + pagetable_pud_dtor(virt_to_ptdesc(pud)); 91 + crst_table_free(mm, (unsigned long *) pud); 79 92 } 80 93 81 94 static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr)
+2
arch/s390/include/asm/tlb.h
··· 122 122 { 123 123 if (mm_p4d_folded(tlb->mm)) 124 124 return; 125 + pagetable_p4d_dtor(virt_to_ptdesc(p4d)); 125 126 __tlb_adjust_range(tlb, address, PAGE_SIZE); 126 127 tlb->mm->context.flush_mm = 1; 127 128 tlb->freed_tables = 1; ··· 141 140 { 142 141 if (mm_pud_folded(tlb->mm)) 143 142 return; 143 + pagetable_pud_dtor(virt_to_ptdesc(pud)); 144 144 tlb->mm->context.flush_mm = 1; 145 145 tlb->freed_tables = 1; 146 146 tlb->cleared_p4ds = 1;