linux-parisc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][RFC] parisc: Change L1_CACHE_BYTES to 16
@ 2015-09-26 15:38 John David Anglin
  2015-09-27 16:07 ` [PATCH v2][RFC] " John David Anglin
  0 siblings, 1 reply; 24+ messages in thread
From: John David Anglin @ 2015-09-26 15:38 UTC (permalink / raw)
  To: linux-parisc List; +Cc: Helge Deller, James Bottomley

[-- Attachment #1: Type: text/plain, Size: 957 bytes --]

The attached change reduces L1_CACHE_BYTES from 32 on PA1.1 and 64 on PA2.0 to 16.

This is based on examination of the L1 cache design for the PA-8700 processor where it can
be seen the processor loads two double words per cycle.  This line length is consistent with the
original alignment requirement for the ldcw instruction.

Thus, we need to distinguish between the L1 and L2 (SMP) cache line lengths.

The attached change bumps SMP_CACHE_BYTES to 128 bytes as this is the line length used
on PA-8800 and PA-8900 processors.  This increases the overall kernel size somewhat but seems
logically correct.

I left ARCH_DMA_MINALIGN at L1_CACHE_BYTES as that's the define most architectures use.

There are a few uses of L1_CACHE_BYTES in drivers/parisc.  This is the code that's most likely
to break from the change.

I have lightly tested the change on c8000 running 4.2.1+.

Signed-off-by: John David Anglin <dave.anglin@bell.net>


[-- Attachment #2: cache.h.d.txt --]
[-- Type: text/plain, Size: 1228 bytes --]

diff --git a/arch/parisc/include/asm/cache.h b/arch/parisc/include/asm/cache.h
index 47f11c7..e92a355 100644
--- a/arch/parisc/include/asm/cache.h
+++ b/arch/parisc/include/asm/cache.h
@@ -7,24 +7,23 @@
 
 
 /*
- * PA 2.0 processors have 64-byte cachelines; PA 1.1 processors have
- * 32-byte cachelines.  The default configuration is not for SMP anyway,
+ * PA 2.0 processors have 64 and 128-byte L2 cachelines; PA 1.1 processors
+ * have 32-byte cachelines.  The default configuration is not for SMP anyway,
  * so if you're building for SMP, you should select the appropriate
  * processor type.  There is a potential livelock danger when running
  * a machine with this value set too small, but it's more probable you'll
  * just ruin performance.
  */
-#ifdef CONFIG_PA20
-#define L1_CACHE_BYTES 64
-#define L1_CACHE_SHIFT 6
-#else
-#define L1_CACHE_BYTES 32
-#define L1_CACHE_SHIFT 5
-#endif
+#define L1_CACHE_BYTES 16
+#define L1_CACHE_SHIFT 4
 
 #ifndef __ASSEMBLY__
 
-#define SMP_CACHE_BYTES L1_CACHE_BYTES
+#ifdef CONFIG_PA20
+#define SMP_CACHE_BYTES (8 * L1_CACHE_BYTES)
+#else
+#define SMP_CACHE_BYTES (2 * L1_CACHE_BYTES)
+#endif
 
 #define ARCH_DMA_MINALIGN	L1_CACHE_BYTES
 

[-- Attachment #3: Type: text/plain, Size: 44 bytes --]



--
John David Anglin	dave.anglin@bell.net

^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2015-10-25  5:41 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-26 15:38 [PATCH][RFC] parisc: Change L1_CACHE_BYTES to 16 John David Anglin
2015-09-27 16:07 ` [PATCH v2][RFC] " John David Anglin
2015-09-27 16:17   ` James Bottomley
2015-09-27 16:46     ` John David Anglin
2015-10-15  0:32   ` [PATCH v3] " John David Anglin
2015-10-22 11:38     ` Aw: " Helge Deller
2015-10-22 11:53       ` Helge Deller
2015-10-22 14:35         ` James Bottomley
2015-10-22 14:53           ` John David Anglin
2015-10-22 20:00             ` CONFIG_XPS depends on L1_CACHE_BYTES being greater than sizeof(struct xps_map) Helge Deller
2015-10-22 21:37               ` Tom Herbert
2015-10-23 19:21                 ` Helge Deller
2015-10-23 22:16                   ` Tom Herbert
2015-10-22 21:50               ` Eric Dumazet
2015-10-23 19:25                 ` Helge Deller
2015-10-23 20:03                   ` Eric Dumazet
2015-10-23 21:08                     ` Helge Deller
2015-10-23 21:09                       ` Helge Deller
2015-10-23 21:38                       ` Eric Dumazet
2015-10-23 22:00                       ` Alexander Duyck
2015-10-23 22:17                         ` Helge Deller
2015-10-23 22:40                           ` Alexander Duyck
2015-10-24 14:43                             ` Helge Deller
2015-10-25  5:41                               ` Alexander Duyck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).