Add GC_CACHE_COHERENT_ON
authorjzhou <jzhou>
Wed, 20 Jul 2011 19:02:36 +0000 (19:02 +0000)
committerjzhou <jzhou>
Wed, 20 Jul 2011 19:02:36 +0000 (19:02 +0000)
Robust/src/Runtime/bamboo/multicorecache.c

index c8f50fd0fbf4398281350ae26f87c173058ab4e0..52a725a715f6a35732e940e956af1e924fbc1a6f 100644 (file)
@@ -103,6 +103,18 @@ void cacheadapt_finish_dst_page(void *origptr, void *tostart, void *toptr, unsig
 //   -- 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_POLICY3)&&defined(GC_CACHE_ADAPT_POLICY4)
+    // 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();
 
@@ -114,6 +126,7 @@ void cacheAdapt_gc(bool isgccachestage) {
   } else {
     bamboo_install_dtlb_handler_for_mutator();
   }
+#endif
 } 
 
 // the master core decides how to adapt cache strategy for the mutator