Skip to content

Commit 14c2ac3

Browse files
Qi Zhengakpm00
authored andcommitted
LoongArch: update local TLB if PTE entry exists
Currently, the implementation of update_mmu_tlb() is empty if __HAVE_ARCH_UPDATE_MMU_TLB is not defined. Then if two threads concurrently fault at the same page, the second thread that did not win the race will give up and do nothing. In the LoongArch architecture, this second thread will trigger another fault, and only updates its local TLB. Instead of triggering another fault, it's better to implement update_mmu_tlb() to directly update the local TLB of the second thread. Just do it. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Qi Zheng <[email protected]> Suggested-by: Bibo Mao <[email protected]> Acked-by: Huacai Chen <[email protected]> Cc: Chris Zankel <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Max Filippov <[email protected]> Cc: Muchun Song <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent bce8cb3 commit 14c2ac3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/loongarch/include/asm/pgtable.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,9 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
412412
__update_tlb(vma, address, ptep);
413413
}
414414

415+
#define __HAVE_ARCH_UPDATE_MMU_TLB
416+
#define update_mmu_tlb update_mmu_cache
417+
415418
static inline void update_mmu_cache_pmd(struct vm_area_struct *vma,
416419
unsigned long address, pmd_t *pmdp)
417420
{

0 commit comments

Comments
 (0)