Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* patch for include/asm-alpha/cache.h
@ 2000-03-20  3:24 werner
  2000-03-20 18:40 ` Richard Henderson
  0 siblings, 1 reply; 4+ messages in thread
From: werner @ 2000-03-20  3:24 UTC (permalink / raw)
  To: axp-list, torvalds

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

what is the status of adding page coloring for Alpha?

[-- Attachment #2: Makefile.diff --]
[-- Type: text/plain, Size: 1602 bytes --]

--- linux/arch/alpha/Makefile.orig	Sun Mar 19 16:51:44 2000
+++ linux/arch/alpha/Makefile	Sun Mar 19 16:49:57 2000
@@ -31,37 +31,37 @@
   # more likely to keep an EV4 processor busy than vice-versa.
   mcpu_done := n
   ifeq ($(CONFIG_ALPHA_GENERIC),y)
-    CFLAGS := $(CFLAGS) -mcpu=ev5
+    CFLAGS := $(CFLAGS) -mcpu=ev5 -DCPU=EV5
     mcpu_done := y
   endif
   ifeq ($(mcpu_done)$(CONFIG_ALPHA_PYXIS),ny)
-    CFLAGS := $(CFLAGS) -mcpu=ev56
+    CFLAGS := $(CFLAGS) -mcpu=ev56 -DCPU=EV5
     mcpu_done := y
   endif
   ifeq ($(mcpu_done)$(CONFIG_ALPHA_POLARIS),ny)
     ifeq ($(have_mcpu_pca56),y)
-      CFLAGS := $(CFLAGS) -mcpu=pca56
+      CFLAGS := $(CFLAGS) -mcpu=pca56 -DCPU=EV5
     else
-      CFLAGS := $(CFLAGS) -mcpu=ev56
+      CFLAGS := $(CFLAGS) -mcpu=ev56 -DCPU=EV5
     endif
     mcpu_done := y
   endif
   ifeq ($(mcpu_done)$(CONFIG_ALPHA_NAUTILUS)$(have_mcpu_ev67),nyy)
-    CFLAGS := $(CFLAGS) -mcpu=ev67
+    CFLAGS := $(CFLAGS) -mcpu=ev67 -DCPU=EV6
     mcpu_done := y
   endif
   ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV4),ny)
-    CFLAGS := $(CFLAGS) -mcpu=ev4
+    CFLAGS := $(CFLAGS) -mcpu=ev4 -DCPU=EV4
     mcpu_done := y
   endif
   ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV6),ny)
     ifeq ($(have_mcpu_ev6),y)
-      CFLAGS := $(CFLAGS) -mcpu=ev6
+      CFLAGS := $(CFLAGS) -mcpu=ev6 -DCPU=EV6
     else
       ifeq ($(have_mcpu_pca56),y)
-        CFLAGS := $(CFLAGS) -mcpu=pca56
+        CFLAGS := $(CFLAGS) -mcpu=pca56 -DCPU=EV5
       else
-        CFLAGS := $(CFLAGS) -mcpu=ev56
+        CFLAGS := $(CFLAGS) -mcpu=ev56 -DCPU=EV5
       endif
     endif
     mcpu_done := y

[-- Attachment #3: cache.h.diff --]
[-- Type: text/plain, Size: 1956 bytes --]

--- linux/include/asm-alpha/cache.h.orig	Sun Mar 19 16:39:23 2000
+++ linux/include/asm-alpha/cache.h	Sun Mar 19 19:11:23 2000
@@ -1,12 +1,53 @@
 /*
  * include/asm-alpha/cache.h
+ *
+ * Modified 03/19/2000 by Michael Werner to include more details
+ * of the Alpha processors for future optimizations,
+ * for example, processor dependent page coloring.
  */
+
 #ifndef __ARCH_ALPHA_CACHE_H
 #define __ARCH_ALPHA_CACHE_H
 
-/* Bytes per L1 (data) cache line.  Both EV4 and EV5 are write-through,
-   read-allocate, direct-mapped, physical. */
+/* L1_CACHE_BYTES is Bytes per L1 (data) cache line.  
+ *  L1_CACHE_PAGES is the size of the L1 data cache in units of default pages 
+ */
+
+/*
+ *  EV5 has a dual-read-ported, single-write-ported, 8KB data cache. 
+ *  It is a write-through, read-allocate, direct-mapped, physical cache
+ *  with 32-byte blocks. 
+ *  See 21164 and 21164PC Alpha Microprocessor Data Sheets.  
+ */
+
+#if CPU==EV4 || CPU==EV5
 #define L1_CACHE_BYTES     32
+#define L1_CACHE_PAGES      1
+
+/* 
+ *  EV6 has a virtually-indexed, physically-tagged two-way associative 
+ *  write-back, read/write allocate  64KB data cache.
+ *  See 21264 Alpha Microprocessor Data Sheet at
+ *  http://ftp.digital.com/pub/Digital/info/semiconductor/literature/dsc-library.html
+ *
+ *  Avoid touching data that is 32KB apart. 
+ *  The 21264 can have only one memory operation in progress at a time
+ *  that maps to any one cache index. Otherwise a replay trap may result.
+ *  See 21264 Compilers Writers Guide for more information.
+ */
+
+#elif CPU==EV6 || CPU==EV67 || CPU==EV7
+#define L1_CACHE_BYTES     64
+#define L1_CACHE_PAGES      8
+#else
+
+/* Force errors in compilation so the correct values are assigned rather than defaults */
+
+#define L1_CACHE_BYTES      0
+#define L1_CACHE_PAGES      0
+#endif
+
+
 #define L1_CACHE_ALIGN(x)  (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
 #define SMP_CACHE_BYTES    L1_CACHE_BYTES
 

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

* Re: patch for include/asm-alpha/cache.h
  2000-03-20  3:24 patch for include/asm-alpha/cache.h werner
@ 2000-03-20 18:40 ` Richard Henderson
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2000-03-20 18:40 UTC (permalink / raw)
  To: axp-list; +Cc: torvalds

On Sun, Mar 19, 2000 at 07:24:38PM -0800, werner@darkwing.uoregon.edu wrote:
> +    CFLAGS := $(CFLAGS) -mcpu=ev5 -DCPU=EV5

Don't do this.  We already have perfectly fine cpu defines.


r~


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

* Re: patch for include/asm-alpha/cache.h
       [not found] <Pine.LNX.4.10.10003191931230.20342-100000@penguin.transmeta.com>
@ 2000-03-20 21:00 ` werner
  2000-03-20 21:20   ` Phillip Ezolt
  0 siblings, 1 reply; 4+ messages in thread
From: werner @ 2000-03-20 21:00 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: axp-list

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

Linus Torvalds wrote:

>
> It's much better to have specific CONFIG_xxx options that are set
> automatically depending on the CPU type (see, for example, the way the x86
> stuff sets "CONFIG_X86_WP_WORKS_OK" or whatever we called those options).
> That makes for much more readable code, and makes the configure scripts
> work correctly on dependencies.
>
> So I'd suggest a CONFIG_L1_CACHELINE define for the size of the L1
> cacheline instead of having CPU defines and then checking those.
>
>                 Linus

CONFIG_X86_WP_WORKS_OK only takes boolean values so I tried a compromise.
I now use the config.h way, don't add any new CONFIG_xx options but still
test cpu type in cache.h.
It should work with i386 as well but I don't know how the cache lines vary
across the many versions.

Yours,
Mike

[-- Attachment #2: cache.h.diff --]
[-- Type: text/plain, Size: 1941 bytes --]

--- cache.h.orig	Sun Mar 19 16:39:23 2000
+++ cache.h	Mon Mar 20 12:38:14 2000
@@ -1,12 +1,54 @@
 /*
  * include/asm-alpha/cache.h
+ *
+ * Modified 03/20/2000 by Michael Werner to include more details
+ * of the Alpha processors for future optimizations,
+ * for example, processor dependent page coloring.
  */
+
 #ifndef __ARCH_ALPHA_CACHE_H
 #define __ARCH_ALPHA_CACHE_H
 
-/* Bytes per L1 (data) cache line.  Both EV4 and EV5 are write-through,
-   read-allocate, direct-mapped, physical. */
+#include <linux/config.h>
+
+/* L1_CACHE_BYTES is Bytes per L1 (data) cache line.  
+ * L1_CACHE_PAGES is the size of the L1 data cache in units of default pages 
+ */
+
+/*
+ *  EV5 has a dual-read-ported, single-write-ported, 8KB data cache. 
+ *  It is a write-through, read-allocate, direct-mapped, physical cache
+ *  with 32-byte blocks. 
+ *  See 21164 and 21164PC Alpha Microprocessor Data Sheets.  
+ */
+
+#if defined(CONFIG_ALPHA_EV4) || defined(CONFIG_ALPHA_EV5)
 #define L1_CACHE_BYTES     32
+#define L1_CACHE_PAGES      1
+
+/* 
+ *  EV6 has a virtually-indexed, physically-tagged two-way associative 
+ *  write-back, read/write allocate  64KB data cache.
+ *  See 21264 Alpha Microprocessor Data Sheet at
+ *  http://ftp.digital.com/pub/Digital/info/semiconductor/literature/dsc-library.html
+ *
+ *  Avoid touching data that is 32KB apart. 
+ *  The 21264 can have only one memory operation in progress at a time
+ *  that maps to any one cache index. Otherwise a replay trap may result.
+ *  See 21264 Compilers Writers Guide for more information.
+ */
+
+#elif defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV7)
+#define L1_CACHE_BYTES     64
+#define L1_CACHE_PAGES      8
+#else
+
+/* Default back to previous behaviour */
+#define L1_CACHE_BYTES     32 
+#define L1_CACHE_PAGES      1
+#endif
+
+
 #define L1_CACHE_ALIGN(x)  (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
 #define SMP_CACHE_BYTES    L1_CACHE_BYTES
 

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

* Re: patch for include/asm-alpha/cache.h
  2000-03-20 21:00 ` werner
@ 2000-03-20 21:20   ` Phillip Ezolt
  0 siblings, 0 replies; 4+ messages in thread
From: Phillip Ezolt @ 2000-03-20 21:20 UTC (permalink / raw)
  To: werner; +Cc: axp-list, Linus Torvalds

Mike,
	I don't know exactly what you are trying to do, but won't this
make the generic-kernel case harder?  

In an ideal world, a generic kernel would be able to determine which type of
processor it is running on, and run optimally on that. 

Won't this patch require you to recompile your kernel for each alpha
implmentation?  (EV4 vs. EV5 vs. EV6)

Why not have them defined in all cases, and then properly select the
right value at run time?  Or is this not possible? 

--Phil

Compaq:  High Performance Server Division/Benchmark Performance Engineering 
---------------- Alpha, The Fastest Processor on Earth --------------------
Phillip.Ezolt@compaq.com        |C|O|M|P|A|Q|        ezolt@perf.zko.dec.com
------------------- See the results at www.spec.org -----------------------

On Mon, 20 Mar 2000 werner@darkwing.uoregon.edu wrote:

> Linus Torvalds wrote:
> 
> >
> > It's much better to have specific CONFIG_xxx options that are set
> > automatically depending on the CPU type (see, for example, the way the x86
> > stuff sets "CONFIG_X86_WP_WORKS_OK" or whatever we called those options).
> > That makes for much more readable code, and makes the configure scripts
> > work correctly on dependencies.
> >
> > So I'd suggest a CONFIG_L1_CACHELINE define for the size of the L1
> > cacheline instead of having CPU defines and then checking those.
> >
> >                 Linus
> 
> CONFIG_X86_WP_WORKS_OK only takes boolean values so I tried a compromise.
> I now use the config.h way, don't add any new CONFIG_xx options but still
> test cpu type in cache.h.
> It should work with i386 as well but I don't know how the cache lines vary
> across the many versions.
> 
> Yours,
> Mike
> 


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

end of thread, other threads:[~2000-03-20 21:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-03-20  3:24 patch for include/asm-alpha/cache.h werner
2000-03-20 18:40 ` Richard Henderson
     [not found] <Pine.LNX.4.10.10003191931230.20342-100000@penguin.transmeta.com>
2000-03-20 21:00 ` werner
2000-03-20 21:20   ` Phillip Ezolt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox