[PATCH] arch/powerpc/64: Avoid isync in flush_dcache_range

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE2351d LANDED

Landed in mainline as 233ba5461838 on 2020-03-27.

5 messages, 3 authors, 2020-04-01 · open the first message on its own page

[PATCH] arch/powerpc/64: Avoid isync in flush_dcache_range

From: Aneesh Kumar K.V <hidden>
Date: 2020-03-20 10:46:01

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 <redacted>
---
Note: IIUC we can also void the sync fore dcbf.

 arch/powerpc/include/asm/cacheflush.h | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/arch/powerpc/include/asm/cacheflush.h b/arch/powerpc/include/asm/cacheflush.h
index 4a1c9f0200e1..e92191b390f3 100644
--- a/arch/powerpc/include/asm/cacheflush.h
+++ b/arch/powerpc/include/asm/cacheflush.h
@@ -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();
 }
 
 /*
-- 
2.25.1

Re: [PATCH] arch/powerpc/64: Avoid isync in flush_dcache_range

From: Segher Boessenkool <hidden>
Date: 2020-03-20 15:09:44

On Fri, Mar 20, 2020 at 04:02:42PM +0530, Aneesh Kumar K.V wrote:
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

Re: [PATCH] arch/powerpc/64: Avoid isync in flush_dcache_range

From: Aneesh Kumar K.V <hidden>
Date: 2020-03-20 15:15:48

On 3/20/20 8:35 PM, Segher Boessenkool wrote:
On Fri, Mar 20, 2020 at 04:02:42PM +0530, Aneesh Kumar K.V wrote:
quoted
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

Re: [PATCH] arch/powerpc/64: Avoid isync in flush_dcache_range

From: Segher Boessenkool <hidden>
Date: 2020-03-20 15:33:37

On Fri, Mar 20, 2020 at 08:38:42PM +0530, Aneesh Kumar K.V wrote:
On 3/20/20 8:35 PM, Segher Boessenkool wrote:
quoted
On Fri, Mar 20, 2020 at 04:02:42PM +0530, Aneesh Kumar K.V wrote:
quoted
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.
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

Re: [PATCH] arch/powerpc/64: Avoid isync in flush_dcache_range

From: Michael Ellerman <hidden>
Date: 2020-04-01 13:37:50

On Fri, 2020-03-20 at 10:32:42 UTC, "Aneesh Kumar K.V" wrote:
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 <redacted>
Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/233ba5461838a56c19600216f0919e7cd3aec40e

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help