Skip to content

more mm switching vs TLB shootdown and lazy tlb fixes

Nicholas Piggin linux-arch linux-mm linuxppc-dev lkml sparclinux 2 versions – Applied

Status from this message: Applied to powerpc/next.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 11 repliesApplied
  2. v14 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- Updates from Michael Ellerman's review comments.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/4mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching racearch/Kconfig fs/exec.c+22 -24 replies
2/4powerpc: select ARCH_WANT_IRQS_OFF_ACTIVATE_MMarch/powerpc/Kconfig arch/powerpc/include/asm/mmu_context.h+2 -10 replies
3/4sparc64: remove mm_cpumask clearing to fix kthread_use_mm racearch/sparc/kernel/smp_64.c+14 -516 replies
4/4powerpc/64s/radix: Fix mm_cpumask trimming race vs kthread_use_mmarch/powerpc/include/asm/tlb.h arch/powerpc/mm/book3s64/radix_tlb.c+16 -200 replies

Reviews trailers per patch

3 of 4 patches have a Reviewed-by or Acked-by.

PatchMichael EllermanPeter Zijlstra (Intel)David S. Miller
1/4A-b
2/4
3/4A-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/4] more mm switching vs TLB shootdown and lazy tlb fixes

This is an attempt to fix a few different related issues around switching mm, TLB flushing, and lazy tlb mm handling.

This will require all architectures to eventually move to disabling irqs over activate_mm, but it's possible we could add another arch call after irqs are re-enabled for those few which can't do their entire activation with irqs disabled.

Testing so far indicates this has fixed a mm refcounting bug that powerpc was running into (via distro report and backport). I haven't had any real feedback on this series outside powerpc (and it doesn't really affect other archs), so I propose patches 1,2,4 go via the powerpc tree.

There is no dependency between them and patch 3, I put it there only because it follows the history of the code (powerpc code was written using the sparc64 logic), but I guess they have to go via different arch trees. Dave, I'll leave patch 3 with you.

Thanks,
Nick

Since v1:
- Updates from Michael Ellerman's review comments.

Nicholas Piggin (4):
mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race
powerpc: select ARCH_WANT_IRQS_OFF_ACTIVATE_MM
sparc64: remove mm_cpumask clearing to fix kthread_use_mm race powerpc/64s/radix: Fix mm_cpumask trimming race vs kthread_use_mm

 arch/Kconfig                           |  7 +++
 arch/powerpc/Kconfig                   |  1 +
 arch/powerpc/include/asm/mmu_context.h |  2 +-
 arch/powerpc/include/asm/tlb.h         | 13 ------
 arch/powerpc/mm/book3s64/radix_tlb.c   | 23 ++++++---
 arch/sparc/kernel/smp_64.c             | 65 ++++++--------------------
 fs/exec.c                              | 17 ++++++-
 7 files changed, 54 insertions(+), 74 deletions(-)
Signature · 1 line
2.23.0