mm/mmu_notifier: avoid double notification when it is useless
This patch only affects users of mmu_notifier->invalidate_range callback which are device drivers related to ATS/PASID, CAPI, IOMMUv2, SVM ... and it is an optimization for those users. Everyone else is unaffected by it. When clearing a pte/pmd we are given a choice to notify the event under the page table lock (notify version of *_clear_flush helpers do call the mmu_notifier_invalidate_range). But that notification is not necessary in all cases. This patch removes almost all cases where it is useless to have a call to mmu_notifier_invalidate_range before mmu_notifier_invalidate_range_end. It also adds documentation in all those cases explaining why. Below is a more in depth analysis of why this is fine to do this: For secondary TLB (non CPU TLB) like IOMMU TLB or device TLB (when device use thing like ATS/PASID to get the IOMMU to walk the CPU page table to access a process virtual address space). There is only 2 cases when you need to...
Showing
- Documentation/vm/mmu_notifier.txt 93 additions, 0 deletionsDocumentation/vm/mmu_notifier.txt
- fs/dax.c 7 additions, 2 deletionsfs/dax.c
- include/linux/mmu_notifier.h 2 additions, 1 deletioninclude/linux/mmu_notifier.h
- mm/huge_memory.c 17 additions, 3 deletionsmm/huge_memory.c
- mm/hugetlb.c 13 additions, 3 deletionsmm/hugetlb.c
- mm/ksm.c 13 additions, 2 deletionsmm/ksm.c
- mm/rmap.c 53 additions, 6 deletionsmm/rmap.c
Please register or sign in to comment