Page coloring for boxboro tests
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 4 May 2010 21:50:37 +0000 (14:50 -0700)
committerKevin Klues <klueska@cs.berkeley.edu>
Thu, 3 Nov 2011 00:35:47 +0000 (17:35 -0700)
Use the example macros in manager.c.  If you just create, but don't run,
don't forget to proc_decref() after schedule_proc() or whatever.

Makeconfig
Makelocal.template
kern/arch/i686/colored_caches.c
kern/src/manager.c

index 694c7f1..77ab4bd 100644 (file)
@@ -26,6 +26,7 @@ CONFIG_DISABLE_MPTABLES:=          -D__CONFIG_DISABLE_MPTABLES__
 CONFIG_EXPER_TRADPROC:=            -D__CONFIG_EXPER_TRADPROC__
 CONFIG_MONITOR_ON_INT:=            -D__CONFIG_MONITOR_ON_INT__
 CONFIG_DISABLE_SMT:=               -D__CONFIG_DISABLE_SMT__
+CONFIG_BOXBORO:=                   -D__CONFIG_BOXBORO__
 
 # Userspace configuration parameters
 # By default, each of these options will be turned off
index c18f18d..076b7b4 100644 (file)
@@ -22,6 +22,7 @@
 #KERN_CFLAGS += $(CONFIG_EXPER_TRADPROC)
 #KERN_CFLAGS += $(CONFIG_MONITOR_ON_INT)
 #KERN_CFLAGS += $(CONFIG_DISABLE_SMT)
+#KERN_CFLAGS += $(CONFIG_BOXBORO)
 
 #KERN_CFLAGS += -DDEVELOPER_NAME=waterman
 #KERN_CFLAGS += -DDEVELOPER_NAME=brho
index b9373b9..95c91c0 100644 (file)
@@ -34,9 +34,16 @@ void cache_init()
        available_caches.l2 = SINIT(&l2);
        available_caches.l3 = SINIT(&l3);
        llc_cache = &l3;
-       init_cache_properties(&l1,   32,  8, 64);
-       init_cache_properties(&l2,  256,  8, 64);
-       init_cache_properties(&l3, 8192, 16, 64);
+#ifdef __CONFIG_BOXBORO__
+       /* level (ignoring L1I), size, ways, CL size) */
+       init_cache_properties(&l1,   32,  8, 64);       /* 1 color */
+       init_cache_properties(&l2,  256,  8, 64);       /* 16 colors */
+       init_cache_properties(&l3, 24576, 24, 64);      /* 256 colors */
+#else /* Core i7 */
+       init_cache_properties(&l1,   32,  8, 64);       /* 1 color */
+       init_cache_properties(&l2,  256,  8, 64);       /* 16 colors */
+       init_cache_properties(&l3, 8192, 16, 64);       /* 128 colors */
+#endif /* __CONFIG_E1000_ON_BOXBORO__ */
        printk("Cache init successful\n");
 }
 
index 84ea70f..d129ee4 100644 (file)
@@ -63,6 +63,32 @@ void manager(void)
        proc_run((p));                                                               \
        proc_decref((p), 1);
 
+#define quick_proc_create(x, p)                                                  \
+       (p) = kfs_proc_create(kfs_lookup_path((x)));                                 \
+       spin_lock(&(p)->proc_lock);                                                  \
+       __proc_set_state((p), PROC_RUNNABLE_S);                                      \
+       spin_unlock(&(p)->proc_lock);
+
+#define quick_proc_color_run(x, p, c)                                            \
+       (p) = kfs_proc_create(kfs_lookup_path((x)));                                 \
+       spin_lock(&(p)->proc_lock);                                                  \
+       __proc_set_state((p), PROC_RUNNABLE_S);                                      \
+       spin_unlock(&(p)->proc_lock);                                                \
+       p->cache_colors_map = cache_colors_map_alloc();                              \
+       for (int i = 0; i < (c); i++)                                                \
+               cache_color_alloc(llc_cache, p->cache_colors_map);                       \
+       proc_run((p));                                                               \
+       proc_decref((p), 1);
+
+#define quick_proc_color_create(x, p, c)                                         \
+       (p) = kfs_proc_create(kfs_lookup_path((x)));                                 \
+       spin_lock(&(p)->proc_lock);                                                  \
+       __proc_set_state((p), PROC_RUNNABLE_S);                                      \
+       spin_unlock(&(p)->proc_lock);                                                \
+       p->cache_colors_map = cache_colors_map_alloc();                              \
+       for (int i = 0; i < (c); i++)                                                \
+               cache_color_alloc(llc_cache, p->cache_colors_map);
+
 void manager_brho(void)
 {
        static uint8_t RACY progress = 0;
@@ -74,7 +100,10 @@ void manager_brho(void)
 
        switch (progress++) {
                case 0:
-                       quick_proc_run("msr_dumb_while", p);
+                       /* 124 is half of the available boxboro colors (with the kernel
+                        * getting 8) */
+                       quick_proc_color_run("msr_dumb_while", p, 124);
+                       //quick_proc_run("msr_dumb_while", p);
                        #if 0
                        // this is how you can transition to a parallel process manually
                        // make sure you don't proc run first