For a page that is not used, set its host core as the home core that caches it
authorjzhou <jzhou>
Thu, 14 Jul 2011 15:31:12 +0000 (15:31 +0000)
committerjzhou <jzhou>
Thu, 14 Jul 2011 15:31:12 +0000 (15:31 +0000)
Robust/src/Runtime/bamboo/multicorecache.c

index 512bd9d3af2405aa42c7c7ad36c6be3d5d4ec13e..c9d44e8edb0f9bd578aab735d13ddd82a4180784 100644 (file)
@@ -217,6 +217,12 @@ void cacheAdapt_policy_hottest(int coren){
     if(hotfreq != 0) {
       // locally cache the page in the hottest core
       CACHEADAPT_POLICY_SET_HOST_CORE(policy, hottestcore);
+    } else {
+      // reset it to be homed by its host core
+      unsigned int block = 0;
+      BLOCKINDEX(block, (void *) page_sva);
+      unsigned int coren = gc_block2core[block%(NUMCORES4GC*2)];
+      CACHEADAPT_POLICY_SET_HOST_CORE(policy, coren);
     }
     CACHEADAPT_CHANGE_POLICY_4_PAGE(tmp_p,page_index,policy);
     page_sva += BAMBOO_PAGE_SIZE;
@@ -257,6 +263,12 @@ void cacheAdapt_policy_dominate(int coren){
         // locally cache the page in the hottest core
         CACHEADAPT_POLICY_SET_HOST_CORE(policy, hottestcore);
       }     
+    } else {
+      // reset it to be homed by its host core
+      unsigned int block = 0;
+      BLOCKINDEX(block, (void *) page_sva);
+      unsigned int coren = gc_block2core[block%(NUMCORES4GC*2)];
+      CACHEADAPT_POLICY_SET_HOST_CORE(policy, coren);
     }
     CACHEADAPT_CHANGE_POLICY_4_PAGE(tmp_p,page_index,policy);
     page_sva += BAMBOO_PAGE_SIZE;