arch/powerpc/64: Avoid isync in flush_dcache_range
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
@@ -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
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
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
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
Michael Ellerman
AppliedQuoted 4 lines · Aneesh Kumar K.V
As per ISA and isync is only needed on instruction cache block invalidate. Remove the same from dcache invalidate.
Signed-off-by Aneesh Kumar K.V <[email protected]>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/233ba5461838a56c19600216f0919e7cd3aec40e
cheers