From 28bbc570901fe0b21b03eb7990d0405f3cf5344f Mon Sep 17 00:00:00 2001 From: bdemsky Date: Thu, 30 Jun 2011 08:46:27 +0000 Subject: [PATCH] remove debug printouts --- Robust/src/Runtime/bamboo/multicoregarbage.c | 30 +++++++++++-------- Robust/src/Runtime/bamboo/multicoregarbage.h | 4 +++ .../src/Runtime/bamboo/multicoregccompact.c | 5 ++-- Robust/src/Runtime/bamboo/multicoregcflush.c | 2 ++ Robust/src/Runtime/bamboo/multicoregcmark.c | 6 +++- Robust/src/Runtime/bamboo/multicoremem.c | 3 +- 6 files changed, 32 insertions(+), 18 deletions(-) diff --git a/Robust/src/Runtime/bamboo/multicoregarbage.c b/Robust/src/Runtime/bamboo/multicoregarbage.c index 7f752aad..7a315a6a 100644 --- a/Robust/src/Runtime/bamboo/multicoregarbage.c +++ b/Robust/src/Runtime/bamboo/multicoregarbage.c @@ -162,6 +162,7 @@ void initGC() { } void checkMarkStatus_p2() { + // tprintf("Check mark status 2\n"); // check if the sum of send objs and receive obj are the same // yes->check if the info is the latest; no->go on executing unsigned int sumsendobj = 0; @@ -181,6 +182,7 @@ void checkMarkStatus_p2() { } } if(i == NUMCORESACTIVE) { + //tprintf("Mark terminated\n"); // all the core status info are the latest,stop mark phase gc_status_info.gcphase = COMPACTPHASE; // restore the gcstatus for all cores @@ -204,6 +206,7 @@ void checkMarkStatus_p2() { } void checkMarkStatus() { + // tprintf("Check mark status\n"); if((!waitconfirm)||(waitconfirm && (numconfirm == 0))) { unsigned int entry_index = 0; if(waitconfirm) { @@ -396,11 +399,13 @@ void master_finish() { CACHEADAPT_OUTPUT_CACHE_POLICY(); gc_output_cache_policy_time += (BAMBOO_GET_EXE_TIME()-tmpt); gcflag = false; + GC_SEND_MSG_1_TO_CLIENT(GCFINISH); - - gc_status_info.gcprocessing = false; + gc_status_info.gcprocessing = false; + if(gcflag) { // inform other cores to stop and wait for gc + GC_PRINTF("Back to Back gc case\n"); gcprecheck = true; for(int i = 0; i < NUMCORESACTIVE; i++) { // reuse the gcnumsendobjs & gcnumreceiveobjs @@ -412,7 +417,7 @@ void master_finish() { } void gc_master(struct garbagelist * stackptr) { - tprintf("start GC !!!!!!!!!!!!! \n"); + //tprintf("start GC !!!!!!!!!!!!! \n"); gc_status_info.gcprocessing = true; gc_status_info.gcphase = INITPHASE; @@ -421,33 +426,32 @@ void gc_master(struct garbagelist * stackptr) { initGC(); GC_SEND_MSG_1_TO_CLIENT(GCSTARTINIT); CACHEADAPT_GC(true); - GC_PRINTF("Check core status \n"); + //tprintf("Check core status \n"); GC_CHECK_ALL_CORE_STATUS(); GCPROFILE_ITEM(); unsigned long long tmpt = BAMBOO_GET_EXE_TIME(); CACHEADAPT_OUTPUT_CACHE_SAMPLING(); gc_output_cache_policy_time += (BAMBOO_GET_EXE_TIME()-tmpt); - + //tprintf("start mark phase\n"); // do mark phase master_mark(stackptr); - + //tprintf("finish mark phase\n"); // get large objects from all cores master_getlargeobjs(); - + //tprintf("start compact phase\n"); // compact the heap master_compact(); - + //tprintf("start update phase\n"); // update the references master_updaterefs(stackptr); - GC_PRINTF("gc master finished update \n"); + //tprintf("gc master finished update \n"); // do cache adaptation CACHEADAPT_PHASE_MASTER(); - + //tprintf("finish cachdapt phase\n"); // do finish up stuff master_finish(); - GC_PRINTF("gc finished \n"); - tprintf("finish GC ! %d \n",gcflag); + //tprintf("finish GC ! %d \n",gcflag); } void pregccheck() { @@ -517,6 +521,7 @@ bool gc(struct garbagelist * stackptr) { pregcprocessing(); gc_master(stackptr); } else if(BAMBOO_NUM_OF_CORE < NUMCORES4GC) { + GC_PRINTF("Core reporting for gc.\n"); pregcprocessing(); gc_collect(stackptr); } else { @@ -524,7 +529,6 @@ bool gc(struct garbagelist * stackptr) { gc_nocollect(stackptr); } postgcprocessing(); - return true; } diff --git a/Robust/src/Runtime/bamboo/multicoregarbage.h b/Robust/src/Runtime/bamboo/multicoregarbage.h index bdbd70f8..35e95e80 100644 --- a/Robust/src/Runtime/bamboo/multicoregarbage.h +++ b/Robust/src/Runtime/bamboo/multicoregarbage.h @@ -13,7 +13,11 @@ #define GC_PRINTF if(0) tprintf #endif +#ifdef GC_DEBUG #define TR() tprintf("%u\n",__LINE__) +#else +#define TR() +#endif // data structures for GC #define BAMBOO_SMEM_SIZE_L (BAMBOO_SMEM_SIZE * 2) diff --git a/Robust/src/Runtime/bamboo/multicoregccompact.c b/Robust/src/Runtime/bamboo/multicoregccompact.c index 301c9b50..c5811229 100644 --- a/Robust/src/Runtime/bamboo/multicoregccompact.c +++ b/Robust/src/Runtime/bamboo/multicoregccompact.c @@ -378,6 +378,7 @@ unsigned int compactblocks(struct moveHelper * orig, struct moveHelper * to) { unsigned int length=ALIGNSIZETOBYTES(objlength); //code between this and next comment should be removed +#ifdef GC_DEBUG unsigned int size; unsigned int type; gettype_size(origptr, &type, &size); @@ -390,8 +391,8 @@ unsigned int compactblocks(struct moveHelper * orig, struct moveHelper * to) { 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]); - } +#endif //end of code to remove void *endtoptr=toptr+length; @@ -471,13 +472,11 @@ void master_compact() { // compact phase compact(); /* wait for all cores to finish compacting */ - tprintf("MASTER WAITING\n"); while(!gc_checkCoreStatus()) ; - tprintf("POST_WAIT\n"); GCPROFILE_ITEM(); //just in case we didn't get blocks back... diff --git a/Robust/src/Runtime/bamboo/multicoregcflush.c b/Robust/src/Runtime/bamboo/multicoregcflush.c index 246325a1..df4a978e 100644 --- a/Robust/src/Runtime/bamboo/multicoregcflush.c +++ b/Robust/src/Runtime/bamboo/multicoregcflush.c @@ -28,7 +28,9 @@ extern struct lockvector bamboo_threadlocks; #define updateObj(objptr) gcmappingtbl[OBJMAPPINGINDEX(objptr)] //#define UPDATEOBJ(obj) {void *updatetmpptr=obj; if (updatetmpptr!=NULL) obj=updateObj(updatetmpptr);if (obj>4; unsigned INTPTR lobits=(alignsize&15)<<1; unsigned INTPTR ohigh=gcmarktbl[hibits]; unsigned INTPTR olow=gcmarktbl[hibits+1]; +#endif setLengthMarked(ptr,iunits); + +#ifdef GC_DEBUG unsigned int unit=getMarkedLength(ptr); if (unit!=iunits) { tprintf("Bad mark on %x %u!=%u\n", ptr, unit, iunits); @@ -261,7 +265,7 @@ void mark(struct garbagelist * stackptr) { unsigned INTPTR nlow=gcmarktbl[hibits+1]; tprintf("nhigh=%x nlow=%x", nhigh, nlow); } - +#endif 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 f84ac450..cc82172b 100644 --- a/Robust/src/Runtime/bamboo/multicoremem.c +++ b/Robust/src/Runtime/bamboo/multicoremem.c @@ -98,8 +98,9 @@ void * smemalloc_I(int coren, int isize, int * allocsize) { #elif defined(SMEMG) void *mem = globalmalloc_I(coren, isize, allocsize); #endif + if(mem == NULL) { - // no enough shared global memory + // not enough shared global memory // trigger gc if(!gcflag) { gcflag = true; -- 2.34.1