Le 30/08/2017 à 15:17, Michael Ellerman a écrit :
Frederic Barrat <fbar...@linux.vnet.ibm.com> writes:

With the optimizations introduced by commit a46cc7a90fd8
("powerpc/mm/radix: Improve TLB/PWC flushes"), flush_tlb_mm() no
longer flushes the page walk cache with radix. This patch introduces
flush_all_mm(), which flushes everything, tlb and pwc, for a given mm.

Signed-off-by: Frederic Barrat <fbar...@linux.vnet.ibm.com>
---
Changelog:
v2: this patch is new

  arch/powerpc/include/asm/book3s/64/tlbflush-hash.h  |  8 ++++++++
  arch/powerpc/include/asm/book3s/64/tlbflush-radix.h |  3 +++
  arch/powerpc/include/asm/book3s/64/tlbflush.h       | 15 +++++++++++++++
  arch/powerpc/mm/tlb-radix.c                         |  6 ++++--
  4 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h 
b/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h
index 2f6373144e2c..c5d89d271a96 100644
--- a/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h
+++ b/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h
@@ -65,6 +65,14 @@ static inline void hash__flush_tlb_mm(struct mm_struct *mm)
  {
  }
+static inline void hash__local_flush_all_mm(struct mm_struct *mm)
+{
+}
+
+static inline void hash__flush_all_mm(struct mm_struct *mm)
+{
+}

It's not clear why it makes sense for these to be empty. Either for the
general idea of the "flush_all_mm()" API, or for your intended use by
CXL.

I was not too sure what to do for hash, but the idea is that the new flush_all_mm() is really the equivalent of the old flush_tlb_mm() from before Ben's optimizations for radix, and that was/still is an empty operation on hash, so I kept it that way.

We don't support hash for capi2 yet. Adding it will definitely require some work in that area, as the current approach (use count on the driver and all TLBIs becoming global when the driver is in use) won't hold much longer.

  Fred



Reply via email to