From: bdemsky Date: Tue, 28 Jun 2011 21:27:32 +0000 (+0000) Subject: next roundof bug fixes X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=276640fb0e6dfade8bc50d1d448a582fffc1baa5;p=IRC.git next roundof bug fixes --- diff --git a/Robust/src/Runtime/bamboo/multicoregarbage.c b/Robust/src/Runtime/bamboo/multicoregarbage.c index 320bf91e..7f752aad 100644 --- a/Robust/src/Runtime/bamboo/multicoregarbage.c +++ b/Robust/src/Runtime/bamboo/multicoregarbage.c @@ -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 diff --git a/Robust/src/Runtime/bamboo/multicoregccompact.c b/Robust/src/Runtime/bamboo/multicoregccompact.c index 9354523f..8c26fdeb 100644 --- a/Robust/src/Runtime/bamboo/multicoregccompact.c +++ b/Robust/src/Runtime/bamboo/multicoregccompact.c @@ -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(;nextlocalblocknumstatus=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); diff --git a/Robust/src/Runtime/bamboo/multicoregcflush.c b/Robust/src/Runtime/bamboo/multicoregcflush.c index 2ae416cf..246325a1 100644 --- a/Robust/src/Runtime/bamboo/multicoregcflush.c +++ b/Robust/src/Runtime/bamboo/multicoregcflush.c @@ -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 (objnext) { @@ -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); diff --git a/Robust/src/Runtime/bamboo/multicoregcmark.c b/Robust/src/Runtime/bamboo/multicoregcmark.c index b2afaaad..d4b5813d 100644 --- a/Robust/src/Runtime/bamboo/multicoregcmark.c +++ b/Robust/src/Runtime/bamboo/multicoregcmark.c @@ -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"); diff --git a/Robust/src/Runtime/bamboo/multicoremem.c b/Robust/src/Runtime/bamboo/multicoremem.c index aeb9353c..f84ac450 100644 --- a/Robust/src/Runtime/bamboo/multicoremem.c +++ b/Robust/src/Runtime/bamboo/multicoremem.c @@ -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 diff --git a/Robust/src/Runtime/bamboo/multicoremem.h b/Robust/src/Runtime/bamboo/multicoremem.h index a307c24d..6767354b 100644 --- a/Robust/src/Runtime/bamboo/multicoremem.h +++ b/Robust/src/Runtime/bamboo/multicoremem.h @@ -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 diff --git a/Robust/src/Runtime/bamboo/multicoremsg.c b/Robust/src/Runtime/bamboo/multicoremsg.c index b17828c6..e67016e9 100644 --- a/Robust/src/Runtime/bamboo/multicoremsg.c +++ b/Robust/src/Runtime/bamboo/multicoremsg.c @@ -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) {