next roundof bug fixes
authorbdemsky <bdemsky>
Tue, 28 Jun 2011 21:27:32 +0000 (21:27 +0000)
committerbdemsky <bdemsky>
Tue, 28 Jun 2011 21:27:32 +0000 (21:27 +0000)
Robust/src/Runtime/bamboo/multicoregarbage.c
Robust/src/Runtime/bamboo/multicoregccompact.c
Robust/src/Runtime/bamboo/multicoregcflush.c
Robust/src/Runtime/bamboo/multicoregcmark.c
Robust/src/Runtime/bamboo/multicoremem.c
Robust/src/Runtime/bamboo/multicoremem.h
Robust/src/Runtime/bamboo/multicoremsg.c

index 320bf91e0e0a2a3adb3b0890a5f521052657f411..7f752aad0a51082454ea1343cb297e5cb83b5588 100644 (file)
@@ -214,9 +214,6 @@ void checkMarkStatus() {
       entry_index = gcnumsrobjs_index;
     }
     BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
-    gccorestatus[BAMBOO_NUM_OF_CORE] = 0;  
-    gcnumsendobjs[entry_index][BAMBOO_NUM_OF_CORE] = gcself_numsendobjs;
-    gcnumreceiveobjs[entry_index][BAMBOO_NUM_OF_CORE] = gcself_numreceiveobjs;
     // check the status of all cores
     if (gc_checkCoreStatus()) {
       // ask for confirm
index 9354523fc06f282a0cea97128f71c779239fe336..8c26fdebdb8410b85dbaa0d2cf85eb67c44441ac 100644 (file)
@@ -44,7 +44,6 @@ void handleReturnMem_I(unsigned int cnum, void *heaptop) {
   unsigned int blockindex;
   BLOCKINDEX(blockindex, heaptop);
   unsigned INTPTR localblocknum=GLOBALBLOCK2LOCAL(blockindex);
-
   //this core is done as far as memory usage is concerned
   returnedmem[cnum]=0;
 
@@ -63,7 +62,7 @@ void handleReturnMem_I(unsigned int cnum, void *heaptop) {
     unsigned INTPTR nextlocalblocknum=localblocknum+1;
     for(;nextlocalblocknum<numblockspercore;nextlocalblocknum++) {
       unsigned INTPTR blocknum=BLOCKINDEX2(cnum, nextlocalblocknum);
-      struct blockrecord * nextblockrecord=&allocationinfo.blocktable[blockindex];
+      struct blockrecord * nextblockrecord=&allocationinfo.blocktable[blocknum];
       nextblockrecord->status=BS_FREE;
       nextblockrecord->usedspace=0;
       //this is true because this cannot be the lowest block
@@ -376,6 +375,7 @@ unsigned int compactblocks(struct moveHelper * orig, struct moveHelper * to) {
     if (objlength!=NOTMARKED) {
       unsigned int length=ALIGNSIZETOBYTES(objlength);
 
+      //code between this and next comment should be removed
       unsigned int size;
       unsigned int type;
       gettype_size(origptr, &type, &size);
@@ -383,8 +383,15 @@ unsigned int compactblocks(struct moveHelper * orig, struct moveHelper * to) {
       
       if (size!=length) {
        tprintf("BAD SIZE IN BITMAP: type=%u object=%x size=%u length=%u\n", type, origptr, size, length);
+       unsigned INTPTR alignsize=ALIGNOBJSIZE((unsigned INTPTR)(origptr-gcbaseva));
+       unsigned INTPTR hibits=alignsize>>4;
+       unsigned INTPTR lobits=(alignsize&15)<<1;
+       tprintf("hibits=%x lobits=%x\n", hibits, lobits);
+       tprintf("hi=%x lo=%x\n", gcmarktbl[hibits], gcmarktbl[hibits+1]);
+       
       }
-      
+      //end of code to remove
+
       void *endtoptr=toptr+length;
       if (endtoptr>tobound) {
        gccurr_heaptop-=(unsigned INTPTR)(toptr-toptrinit);
index 2ae416cf66a450a7137ca6dd61c0131df41bc71e..246325a1e1c62a20309738358e5ecf00a2c5840b 100644 (file)
@@ -27,8 +27,10 @@ extern struct lockvector bamboo_threadlocks;
 // NOTE: the objptr should not be NULL and should not be non shared ptr
 #define updateObj(objptr) gcmappingtbl[OBJMAPPINGINDEX(objptr)]
 //#define UPDATEOBJ(obj) {void *updatetmpptr=obj; if (updatetmpptr!=NULL) obj=updateObj(updatetmpptr);if (obj<gcbaseva) tprintf("BAD PTR %x to %x in %u\n", updatetmpptr, obj, __LINE__);}
-#define UPDATEOBJ(obj) {void *updatetmpptr=obj; if (updatetmpptr!=NULL) obj=updateObj(updatetmpptr);}
+#define UPDATEOBJ(obj) {void *updatetmpptr=obj; if (updatetmpptr!=NULL) {obj=updateObj(updatetmpptr);}}
+//if (obj==NULL) tprintf("Mapping problem for object %x, mark=%u, line=%u\n", updatetmpptr, getMarkedLength(updatetmpptr),__LINE__);}}
 #define UPDATEOBJNONNULL(obj) {void *updatetmpptr=obj; obj=updateObj(updatetmpptr);}
+//if (updatetmpptr!=NULL&&obj==NULL) tprintf("Mapping parameter for object %x, mark=%u, line=%u\n", updatetmpptr, getMarkedLength(updatetmpptr),__LINE__);}
 
 INLINE void updategarbagelist(struct garbagelist *listptr) {
   for(;listptr!=NULL; listptr=listptr->next) {
@@ -222,7 +224,7 @@ void * updateblocks(struct moveHelper * orig, struct moveHelper * to) {
         memcpy(dstptr, origptr, length);
       }
 
-      //      tprintf("Moving object %x to %x with length %u\n", origptr, dstptr, length);
+      //tprintf("Moving object %x to %x with length %u\n", origptr, dstptr, length);
 
       /* Update the pointers in the object */
       updatePtrsInObj(dstptr);
index b2afaaad612055523a48b90a23bcef403f9b8df0..d4b5813df0596554a5664335cd0967d437b11bb3 100644 (file)
@@ -254,8 +254,6 @@ void mark(struct garbagelist * stackptr) {
 
       setLengthMarked(ptr,iunits);
 
-      //tprintf("Marking object %x, type %u, length %u, units %u\n", ptr, type, size, iunits);
-
       if(islarge) {
         // ptr is a large object and not marked or enqueued
        printf("NEED TO SUPPORT LARGE OBJECTS!\n");
index aeb9353c5d298c6c9b15f6218637ced7a630f950..f84ac4506ed3b6fc67d347c86db1cddbcd59aea8 100644 (file)
@@ -98,7 +98,6 @@ void * smemalloc_I(int coren, int isize, int * allocsize) {
 #elif defined(SMEMG)
   void *mem = globalmalloc_I(coren, isize, allocsize);
 #endif
-  //  tprintf("Handing core %u memory block %x of size %u\n", coren, mem, *allocsize);
   if(mem == NULL) {
     // no enough shared global memory
     // trigger gc
index a307c24d46f260d952354a9c99c8415a33458f2a..6767354b8cfa8525fd9027dc40be9cd0c6ae394b 100644 (file)
@@ -42,7 +42,7 @@
 #ifdef GC_LARGESHAREDHEAP
 #define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*(2+24)))
 #elif defined MGC
-#define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*(72))) // 72M per core
+#define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*(3))) // 72M per core
 #else
 #define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*(2+14)))
 #endif
@@ -59,7 +59,7 @@
 #define BAMBOO_PAGE_SIZE ((unsigned int)(4 * 64 * 1024)) // 64K
 #define BAMBOO_SMEM_SIZE ((unsigned int)(BAMBOO_PAGE_SIZE))
 #elif defined MGC
-#define BAMBOO_SMEM_SIZE ((unsigned int)(16*(BAMBOO_PAGE_SIZE)))  // 1M
+#define BAMBOO_SMEM_SIZE ((unsigned int)(2*(BAMBOO_PAGE_SIZE)))  // 1M
 #else
 #define BAMBOO_SMEM_SIZE ((unsigned int)(4 * (BAMBOO_PAGE_SIZE)))
 #endif // GC_LARGEPAGESIZE
@@ -69,7 +69,7 @@
 #ifdef GC_LARGESHAREDHEAP
 #define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*(2+5)))
 #elif defined MGC
-#define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*72)) // 72M per core
+#define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*3)) // 72M per core
 #else
 #define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*(2+2))) //(15 * 1024) //(64 * 4 * 0.75) //(1024 * 1024 * 3.5)  3G
 #endif
index b17828c622e91d79f7accbc3dfa9f53f100c9c43..e67016e9bc34d0f683f4ecb87f027a38037a102b 100644 (file)
@@ -434,6 +434,7 @@ INLINE void processmsg_gcstart_I() {
 INLINE void processmsg_gcstartcompact_I() {
   gcblock2fill = msgdata[msgdataindex];
   MSG_INDEXINC_I();  
+  BAMBOO_ASSERT(!gc_status_info.gcbusystatus);
   gc_status_info.gcphase = COMPACTPHASE;
 }
 
@@ -503,6 +504,7 @@ INLINE void processmsg_gcfinishmark_I() {
   MSG_INDEXINC_I();
   // received a mark phase finish msg
   BAMBOO_ASSERT(BAMBOO_NUM_OF_CORE == STARTUPCORE);
+  BAMBOO_ASSERT(gc_status_info.gcphase = MARKPHASE);
 
   // all cores should do mark
   if(data1 < NUMCORESACTIVE) {