Skip to contentSkip to conversation

arch/powerpc/64: Avoid isync in flush_dcache_range

PATCH Applied Aneesh Kumar K.V 3 participants 5 messages Mar 20, 2020 – Apr 1, 2020 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arch/powerpc/64: Avoid isync in flush_dcache_range

As per ISA and isync is only needed on instruction cache block invalidate. Remove the same from dcache invalidate.

---
Note: IIUC we can also void the sync fore dcbf.

 arch/powerpc/include/asm/cacheflush.h | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
arch/powerpc/include/asm/cacheflush.h +1 -5
index 4a1c9f0200e1..e92191b390f3 100644
@@ -65,17 +65,13 @@ static inline void flush_dcache_range(unsigned long start, unsigned long stop)
 	unsigned long size = stop - (unsigned long)addr + (bytes - 1);
 	unsigned long i;
 
-	if (IS_ENABLED(CONFIG_PPC64)) {
+	if (IS_ENABLED(CONFIG_PPC64))
 		mb();	/* sync */
-		isync();
-	}
 
 	for (i = 0; i < size >> shift; i++, addr += bytes)
 		dcbf(addr);
 	mb();	/* sync */
 
-	if (IS_ENABLED(CONFIG_PPC64))
-		isync();
 }
 
 /*
Signature · 1 line
2.25.1
#1 lore raw
Quoted 2 lines · Aneesh Kumar K.V

As per ISA and isync is only needed on instruction cache block invalidate. Remove the same from dcache invalidate.

Is that true on older CPUs?

Segher

#2 lore raw
Quoted 6 lines · Segher Boessenkool
Quoted 2 lines · Aneesh Kumar K.V

As per ISA and isync is only needed on instruction cache block invalidate. Remove the same from dcache invalidate.

Is that true on older CPUs?

That is what I found by checking with hardware team. One thing i was not able to get full confirmation about was the usage of 'sync' before 'dcbf'.

-aneesh

#3 lore raw
Quoted 9 lines · Aneesh Kumar K.V
Quoted 6 lines · Segher Boessenkool
Quoted 2 lines · Aneesh Kumar K.V

As per ISA and isync is only needed on instruction cache block invalidate. Remove the same from dcache invalidate.

Is that true on older CPUs?

That is what I found by checking with hardware team.

Oh, the comment right before this function says "does not invalidat the corresponding insncache blocks", so this looks fine, sorry for not looking closely enough before.

Quoted 2 lines

One thing i was not
able to get full confirmation about was the usage of 'sync' before 'dcbf'.

Yeah, this looks like something that would matter on some implementations. Would it make anything measurably faster if you would remove that sync?

Segher