Gave half of colors to global color map
authorAndrew Waterman <waterman@parcad.millennium.berkeley.edu>
Sun, 10 Jan 2010 02:05:24 +0000 (18:05 -0800)
committerAndrew Waterman <waterman@parcad.millennium.berkeley.edu>
Sun, 10 Jan 2010 02:05:24 +0000 (18:05 -0800)
kern/src/manager.c
kern/src/page_alloc.c

index 6eeca47..80746cb 100644 (file)
@@ -177,9 +177,10 @@ void manager_brho(void)
 void manager_klueska()
 {
        static struct proc *envs[256];
-       static uint8_t progress = 0;
+       static volatile uint8_t progress = 0;
 
-       if (progress++ == 0) {
+       if (progress == 0) {
+               progress++;
                envs[0] = kfs_proc_create(kfs_lookup_path("parlib_matrix"));
                __proc_set_state(envs[0], PROC_RUNNABLE_S);
                proc_run(envs[0]);
index ba98c5b..6fdbf98 100644 (file)
@@ -33,11 +33,8 @@ void colored_page_alloc_init()
        global_cache_colors_map = 
               kmalloc(BYTES_FOR_BITMASK(llc_cache->num_colors), 0);
        CLR_BITMASK(global_cache_colors_map, llc_cache->num_colors);
-       cache_color_alloc(llc_cache, global_cache_colors_map);
-       cache_color_alloc(llc_cache, global_cache_colors_map);
-       cache_color_alloc(llc_cache, global_cache_colors_map);
-       cache_color_alloc(llc_cache, global_cache_colors_map);
-       cache_color_alloc(llc_cache, global_cache_colors_map);
+       for(int i = 0; i < llc_cache->num_colors/2; i++)
+               cache_color_alloc(llc_cache, global_cache_colors_map);
 }
 
 /**