Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm: use update_mmu_tlb() on the second thread

As message in commit 7df676974359 ("mm/memory.c: Update local TLB if PTE
entry exists") said, we should update local TLB only on the second thread.
So in the do_anonymous_page() here, we should use update_mmu_tlb()
instead of update_mmu_cache() on the second thread.

As David pointed out, this is a performance improvement, not a
correctness fix.

Link: https://lkml.kernel.org/r/20220929112318.32393-2-zhengqi.arch@bytedance.com
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Chris Zankel <chris@zankel.net>
Cc: Huacai Chen <chenhuacai@loongson.cn>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Qi Zheng and committed by
Andrew Morton
bce8cb3c d6e5040b

+1 -1
+1 -1
mm/memory.c
··· 4134 4134 vmf->pte = pte_offset_map_lock(vma->vm_mm, vmf->pmd, vmf->address, 4135 4135 &vmf->ptl); 4136 4136 if (!pte_none(*vmf->pte)) { 4137 - update_mmu_cache(vma, vmf->address, vmf->pte); 4137 + update_mmu_tlb(vma, vmf->address, vmf->pte); 4138 4138 goto release; 4139 4139 } 4140 4140