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: pgtable: move __tlb_remove_table_one() in x86 to generic file

The __tlb_remove_table_one() in x86 does not contain architecture-specific
content, so move it to the generic file.

Link: https://lkml.kernel.org/r/aab8a449bc67167943fd2cb5aab0a3a23b7b1cd7.1736317725.git.zhengqi.arch@bytedance.com
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: 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: Peter Zijlstra (Intel) <peterz@infradead.org>
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
e74e1731 92ec7fd1

+18 -21
-19
arch/x86/include/asm/tlb.h
··· 20 20 flush_tlb_mm_range(tlb->mm, start, end, stride_shift, tlb->freed_tables); 21 21 } 22 22 23 - #ifdef CONFIG_PT_RECLAIM 24 - static inline void __tlb_remove_table_one_rcu(struct rcu_head *head) 25 - { 26 - struct ptdesc *ptdesc; 27 - 28 - ptdesc = container_of(head, struct ptdesc, pt_rcu_head); 29 - __tlb_remove_table(ptdesc); 30 - } 31 - 32 - static inline void __tlb_remove_table_one(void *table) 33 - { 34 - struct ptdesc *ptdesc; 35 - 36 - ptdesc = table; 37 - call_rcu(&ptdesc->pt_rcu_head, __tlb_remove_table_one_rcu); 38 - } 39 - #define __tlb_remove_table_one __tlb_remove_table_one 40 - #endif /* CONFIG_PT_RECLAIM */ 41 - 42 23 static inline void invlpg(unsigned long addr) 43 24 { 44 25 asm volatile("invlpg (%0)" ::"r" (addr) : "memory");
+18 -2
mm/mmu_gather.c
··· 311 311 } 312 312 } 313 313 314 - #ifndef __tlb_remove_table_one 314 + #ifdef CONFIG_PT_RECLAIM 315 + static inline void __tlb_remove_table_one_rcu(struct rcu_head *head) 316 + { 317 + struct ptdesc *ptdesc; 318 + 319 + ptdesc = container_of(head, struct ptdesc, pt_rcu_head); 320 + __tlb_remove_table(ptdesc); 321 + } 322 + 323 + static inline void __tlb_remove_table_one(void *table) 324 + { 325 + struct ptdesc *ptdesc; 326 + 327 + ptdesc = table; 328 + call_rcu(&ptdesc->pt_rcu_head, __tlb_remove_table_one_rcu); 329 + } 330 + #else 315 331 static inline void __tlb_remove_table_one(void *table) 316 332 { 317 333 tlb_remove_table_sync_one(); 318 334 __tlb_remove_table(table); 319 335 } 320 - #endif 336 + #endif /* CONFIG_PT_RECLAIM */ 321 337 322 338 static void tlb_remove_table_one(void *table) 323 339 {