// check the statistic data
// for each page, decide the new cache strategy
#ifdef GC_CACHE_ADAPT_POLICY1
- cacheAdapt_policy_h4h(coren);
-#elif defined GC_CACHE_ADAPT_POLICY2
- cacheAdapt_policy_local(coren);
-#elif defined GC_CACHE_ADAPT_POLICY3
- cacheAdapt_policy_hottest(coren);
-#elif defined GC_CACHE_ADAPT_POLICY4
+ // cacheAdapt_policy_h4h(coren);
+#elif defined(GC_CACHE_ADAPT_POLICY2)
+ //cacheAdapt_policy_local(coren);
+#elif defined(GC_CACHE_ADAPT_POLICY3)
+ //cacheAdapt_policy_hottest(coren);
+#elif defined(GC_CACHE_ADAPT_POLICY4)
cacheAdapt_policy_dominate(coren);
#endif
}
// adapt the cache strategy for the mutator
void cacheAdapt_mutator() {
+#if defined(GC_CACHE_ADAPT_POLICY4)
BAMBOO_CACHE_MF();
// check the changes and adapt them
unsigned int * tmp_p = gccachepolicytbl;
}
tmp_p += 1;
}
+#endif
}
// Cache adapt phase process for clients
//send init finish msg to core coordinator
send_msg_2(STARTUPCORE, GCFINISHPREF, BAMBOO_NUM_OF_CORE);
GC_PRINTF("Finish prefinish phase\n");
+
+#if defined(GC_CACHE_ADAPT_POLICY4)
CACHEADAPT_SAMPLING_RESET();
if(BAMBOO_NUM_OF_CORE < NUMCORESACTIVE) {
// zero out the gccachesamplingtbl
BAMBOO_MEMSET_WH(gccachesamplingtbl_local,0,size_cachesamplingtbl_local);
BAMBOO_MEMSET_WH(gccachesamplingtbl_local_r,0,size_cachesamplingtbl_local_r);
}
+#endif
}
extern unsigned long long gc_output_cache_policy_time;
cacheAdapt_gc(false);
GC_CHECK_ALL_CORE_STATUS();
+#if defined(GC_CACHE_ADAPT_POLICY4)
CACHEADAPT_SAMPLING_RESET();
if(BAMBOO_NUM_OF_CORE < NUMCORESACTIVE) {
// zero out the gccachesamplingtbl
BAMBOO_MEMSET_WH(gccachesamplingtbl_local_r,0,size_cachesamplingtbl_local_r);
BAMBOO_MEMSET_WH(gccachepolicytbl,0,size_cachepolicytbl);
}
+#endif
}
// output original cache sampling data for each page
#define CACHEADAPT_SAMPLING_RESET()
#endif
+#if defined(GC_CACHE_ADAPT_POLICY4)
#define CACHEADAPT_FINISH_SRC_PAGE(a,b,c) cacheadapt_finish_src_page(a,b,c);
#define CACHEADAPT_FINISH_DST_PAGE(a,b,c,d) cacheadapt_finish_dst_page(a,b,c,d);
#define CACHEADAPT_FINISH_COMPACT(a) cacheadapt_finish_compact(a);
+#else
+#define CACHEADAPT_FINISH_SRC_PAGE(a,b,c)
+#define CACHEADAPT_FINISH_DST_PAGE(a,b,c,d)
+#define CACHEADAPT_FINISH_COMPACT(a)
+#endif
#define CACHEADAPT_GC(b) cacheAdapt_gc(b)
#define CACHEADAPT_MASTER() cacheAdapt_master()