try to move code around to sync up operations between master and slaves...
authorbdemsky <bdemsky>
Tue, 19 Jul 2011 20:28:16 +0000 (20:28 +0000)
committerbdemsky <bdemsky>
Tue, 19 Jul 2011 20:28:16 +0000 (20:28 +0000)
Robust/src/Runtime/bamboo/multicorecache.c
Robust/src/Runtime/bamboo/multicorecache.h
Robust/src/Runtime/bamboo/multicoregarbage.c

index 6cbe2789e17fd33f5eb88d1846cc0bdaf0b0b50a..32445e7d726dfe8651ec5e9ab93b17f5b5807d7e 100644 (file)
@@ -229,7 +229,7 @@ void cacheAdapt_policy_hottest(int coren){
   }
 } 
 
-#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.
@@ -252,7 +252,7 @@ void cacheAdapt_policy_dominate(int coren){
     // 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;
index 26a26105bdf6314950bf883f8c327ff6a14c7e38..7e90344573a9cb814f6376c2d31121fec47fda39 100644 (file)
@@ -11,7 +11,7 @@
 // time.
 #define GC_CACHE_SAMPLING_UNIT 0x800000000 
 // freqeuency to trigger timer interrupt
-#define GC_TILE_TIMER_EVENT_SETTING 10000000  
+#define GC_TILE_TIMER_EVENT_SETTING 40000000  
 
 // data structure to record policy information for a page
 // should be consistent with multicoreruntime.h
index 0c53142f565004fb2b6850365ce77a6b5e00af88..c705f19f122b92baa7d409db4737787bc18388bf 100644 (file)
@@ -438,11 +438,11 @@ void gc_master(struct garbagelist * stackptr) {
   tprintf("start GC!\n");
   gc_status_info.gcprocessing = true;
   gc_status_info.gcphase = INITPHASE;
+  GC_SEND_MSG_1_TO_CLIENT(GCSTARTINIT);
 
   waitconfirm = false;
   numconfirm = 0;
   initGC();
-  GC_SEND_MSG_1_TO_CLIENT(GCSTARTINIT);
   CACHEADAPT_GC(true);
   //tprintf("Check core status \n");
   GC_CHECK_ALL_CORE_STATUS();
@@ -539,6 +539,7 @@ bool gc(struct garbagelist * stackptr) {
   if(0 == BAMBOO_NUM_OF_CORE) {
     GC_PRINTF("Check if we can do gc or not\n");
     gccorestatus[BAMBOO_NUM_OF_CORE] = 0;
+    pregcprocessing();
 
     //wait for other cores to catch up
     while(!gc_checkCoreStatus())
@@ -547,7 +548,6 @@ bool gc(struct garbagelist * stackptr) {
     pregccheck();
     GCPROFILE_START_MASTER();
     GC_PRINTF("start gc! \n");
-    pregcprocessing();
     gc_master(stackptr);
   } else if(BAMBOO_NUM_OF_CORE < NUMCORES4GC) {
     GC_PRINTF("Core reporting for gc.\n");