Skip to content

Optimize mmu_notifier->invalidate_range callback

[email protected] linux-iommu linux-mm linux-next linuxppc-dev lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 9 repliesIn review 1 of 2 applied

Patches in v1 1 of 2 applied

#Subject and filesSizeRepliesApplied
1/2mm/mmu_notifier: avoid double notification when it is useless v2Documentation/vm/mmu_notifier.txt fs/dax.c include/linux/mmu_notifier.h +4 more+198 -177 replies
2/2mm/mmu_notifier: avoid call to invalidate_range() in range_end()include/linux/mmu_notifier.h mm/huge_memory.c mm/memory.c +2 more+83 -120 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] Optimize mmu_notifier->invalidate_range callback

From: Jérôme Glisse <[email protected]>

(Andrew you already have v1 in your queue of patch 1, patch 2 is new,
i think you can drop it patch 1 v1 for v2, v2 is bit more conservative and i fixed typos)

All this only affect user of invalidate_range callback (at this time CAPI arch/powerpc/platforms/powernv/npu-dma.c, IOMMU ATS/PASID in drivers/iommu/amd_iommu_v2.c|intel-svm.c)

This patchset remove useless double call to mmu_notifier->invalidate_range callback wherever it is safe to do so. The first patch just remove useless call and add documentation explaining why it is safe to do so. The second patch go further by introducing mmu_notifier_invalidate_range_only_end() which skip callback to invalidate_range this can be done when clearing a pte, pmd or pud with notification which call invalidate_range right after clearing under the page table lock.

It should improve performances but i am lacking hardware and benchmarks which might show an improvement. Maybe folks in cc can help here.

Cc Andrea Arcangeli <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Joerg Roedel <[email protected]>
Cc Suravee Suthikulpanit <[email protected]>
Cc David Woodhouse <[email protected]>
Cc Alistair Popple <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Stephen Rothwell <[email protected]>
Cc Andrew Donnellan <[email protected]>

Jérôme Glisse (2):
mm/mmu_notifier: avoid double notification when it is useless v2 mm/mmu_notifier: avoid call to invalidate_range() in range_end()

 Documentation/vm/mmu_notifier.txt | 93 +++++++++++++++++++++++++++++++++++++++
 fs/dax.c                          |  9 +++-
 include/linux/mmu_notifier.h      | 20 +++++++--
 mm/huge_memory.c                  | 66 ++++++++++++++++++++++++---
 mm/hugetlb.c                      | 16 +++++--
 mm/ksm.c                          | 15 ++++++-
 mm/memory.c                       |  6 ++-
 mm/migrate.c                      | 15 +++++--
 mm/mmu_notifier.c                 | 11 ++++-
 mm/rmap.c                         | 59 ++++++++++++++++++++++---
 10 files changed, 281 insertions(+), 29 deletions(-)
 create mode 100644 Documentation/vm/mmu_notifier.txt
Signature · 7 lines
2.13.6

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>