// -- clean dtlb entries
// -- change cache strategy
void cacheAdapt_gc(bool isgccachestage) {
+#ifdef GC_CACHE_COHERENT_ON
+ if(!isgccachestage) {
+ // get out of GC
+#if (defined(GC_CACHE_ADAPT_POLICY4)||defined(GC_CACHE_ADAPT_POLICY3))
+ // flush the shared heap
+ BAMBOO_CACHE_FLUSH_L2();
+
+ // clean the dtlb entries
+ BAMBOO_CLEAN_DTLB();
+#endif
+ }
+#else
// flush the shared heap
BAMBOO_CACHE_FLUSH_L2();
} else {
bamboo_install_dtlb_handler_for_mutator();
}
+#endif
}
// the master core decides how to adapt cache strategy for the mutator
}
}
-#define GC_CACHE_ADAPT_DOMINATE_THRESHOLD 1
+#define GC_CACHE_ADAPT_DOMINATE_THRESHOLD 2
// cache the page on the core that accesses it the most if that core accesses
// it more than (GC_CACHE_ADAPT_DOMINATE_THRESHOLD)% of the total. Otherwise,
// h4h the page.
// Format: page start va + cache policy
if(hotfreq != 0) {
totalfreq=totalfreq>>GC_CACHE_ADAPT_DOMINATE_THRESHOLD;
- if((unsigned int)hotfreq < (unsigned int)totalfreq) {
+ if(hotfreq < totalfreq) {
// use hfh
policy.cache_mode = BAMBOO_CACHE_MODE_HASH;
/*unsigned int block = 0;
#elif defined(GC_CACHE_ADAPT_POLICY2)
//cacheAdapt_policy_local(coren);
#elif defined(GC_CACHE_ADAPT_POLICY3)
- //cacheAdapt_policy_hottest(coren);
+ 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)
+#if (defined(GC_CACHE_ADAPT_POLICY4)||defined(GC_CACHE_ADAPT_POLICY3))
BAMBOO_CACHE_MF();
// check the changes and adapt them
unsigned int * tmp_p = gccachepolicytbl;
send_msg_2(STARTUPCORE, GCFINISHPREF, BAMBOO_NUM_OF_CORE);
GC_PRINTF("Finish prefinish phase\n");
-#if defined(GC_CACHE_ADAPT_POLICY4)
+#if (defined(GC_CACHE_ADAPT_POLICY4)||defined(GC_CACHE_ADAPT_POLICY3))
CACHEADAPT_SAMPLING_RESET();
if(BAMBOO_NUM_OF_CORE < NUMCORESACTIVE) {
// zero out the gccachesamplingtbl
cacheAdapt_gc(false);
GC_CHECK_ALL_CORE_STATUS();
-#if defined(GC_CACHE_ADAPT_POLICY4)
+#if (defined(GC_CACHE_ADAPT_POLICY4)||defined(GC_CACHE_ADAPT_POLICY3))
CACHEADAPT_SAMPLING_RESET();
if(BAMBOO_NUM_OF_CORE < NUMCORESACTIVE) {
// zero out the gccachesamplingtbl