From: bdemsky Date: Wed, 22 Jun 2011 22:18:01 +0000 (+0000) Subject: more bug fixes X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b3677982c10bdd316b5f08658adcdd718e704b20;hp=ed5158384010777d8cbbf0829b6f28e0d73f1796;p=IRC.git more bug fixes --- diff --git a/Robust/src/Runtime/bamboo/multicoregarbage.h b/Robust/src/Runtime/bamboo/multicoregarbage.h index b50f91c0..53503cd6 100644 --- a/Robust/src/Runtime/bamboo/multicoregarbage.h +++ b/Robust/src/Runtime/bamboo/multicoregarbage.h @@ -246,7 +246,7 @@ INLINE static unsigned int hostcore(void * ptr) { //This macro takes in a local block number and returns the size of the block #define BLOCKSIZE(c) \ - ((c)?BAMBOO_SMEM_SIZE_L:BAMBOO_SMEM_SIZE) + ((c)?BAMBOO_SMEM_SIZE:BAMBOO_SMEM_SIZE_L) //This macro takes in a local block number and returns the size of the block #define GLOBALBLOCKSIZE(c) \ diff --git a/Robust/src/Runtime/bamboo/multicoregccompact.c b/Robust/src/Runtime/bamboo/multicoregccompact.c index 8084f83c..6487b1d7 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); - tprintf("Returned mem for core %d\n", cnum); //this core is done as far as memory usage is concerned returnedmem[cnum]=0; @@ -83,8 +82,6 @@ void getSpaceRemotely(struct moveHelper *to, unsigned int minimumbytes) { //need to get another block from elsewhere //set flag to wait for memory if (BAMBOO_NUM_OF_CORE==STARTUPCORE) { - printf("A: %d\n", BAMBOO_NUM_OF_CORE); - gctomove=false; BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT(); void *startaddr=handlegcfinishcompact_I(BAMBOO_NUM_OF_CORE, minimumbytes, gccurr_heaptop); @@ -94,21 +91,14 @@ void getSpaceRemotely(struct moveHelper *to, unsigned int minimumbytes) { } else { while(!gctomove) ; } - printf("BX: %d\n", BAMBOO_NUM_OF_CORE); } else { - printf("CX: %d\n", BAMBOO_NUM_OF_CORE); gctomove=false; //send request for memory send_msg_4(STARTUPCORE,GCFINISHCOMPACT,BAMBOO_NUM_OF_CORE, minimumbytes, gccurr_heaptop); //wait for flag to be set that we received message - printf("XD: %d\n", BAMBOO_NUM_OF_CORE); int cc=0; - while(!gctomove) { - cc++; - if ((cc%100000)==0) - printf("Z"); - } - printf("DD: %d\n", BAMBOO_NUM_OF_CORE); + while(!gctomove) + ; } //store pointer @@ -136,8 +126,6 @@ void compacthelper(struct moveHelper * orig,struct moveHelper * to) { while(true) { if ((gccurr_heaptop < ((unsigned INTPTR)(to->bound-to->ptr)))&&!senttopmessage) { //This block is the last for this core...let the startup know - printf("gchtp=%u tobound=%x toptr=%x\n", gccurr_heaptop, to->bound, to->ptr); - printf("Sending return %d\n", BAMBOO_NUM_OF_CORE); if (BAMBOO_NUM_OF_CORE==STARTUPCORE) { handleReturnMem(BAMBOO_NUM_OF_CORE, to->ptr+gccurr_heaptop); } else { @@ -147,7 +135,6 @@ void compacthelper(struct moveHelper * orig,struct moveHelper * to) { senttopmessage=true; } unsigned int minimumbytes=compactblocks(orig, to); - printf("optr=%x obound=%x\n",orig->ptr, orig->bound); if (orig->ptr==orig->bound) { //need more data to compact //increment the core @@ -159,7 +146,6 @@ void compacthelper(struct moveHelper * orig,struct moveHelper * to) { break; } if (minimumbytes!=0) { - printf("%d needs %u bytes.\n",BAMBOO_NUM_OF_CORE,minimumbytes); getSpace(to, minimumbytes); } } @@ -325,7 +311,7 @@ unsigned int compactblocks(struct moveHelper * orig, struct moveHelper * to) { if (!gcmarktbl[arrayoffset]) { do { arrayoffset++; - if (arrayoffset=origendoffset) { //finished with block... origptr=origbound; to->ptr=toptr; @@ -340,6 +326,7 @@ unsigned int compactblocks(struct moveHelper * orig, struct moveHelper * to) { //Scan more carefully next objlength=getMarkedLength(origptr); + if (objlength!=NOTMARKED) { unsigned int length=ALIGNSIZETOBYTES(objlength); void *endtoptr=toptr+length; diff --git a/Robust/src/Runtime/bamboo/multicoremsg.c b/Robust/src/Runtime/bamboo/multicoremsg.c index c38bb04a..676c5948 100644 --- a/Robust/src/Runtime/bamboo/multicoremsg.c +++ b/Robust/src/Runtime/bamboo/multicoremsg.c @@ -412,16 +412,14 @@ INLINE void processmsg_memresponse_I() { INLINE void processmsg_gcstartpre_I() { // the first time to be informed to start gc gcflag = true; - if(!smemflag) { - // Zero out the remaining memory here because for the GC_CACHE_ADAPT - // version, we need to make sure during the gcinit phase the shared heap - // is not touched. Otherwise, there would be problem when adapt the cache - // strategy. - bamboo_smem_size = 0; - bamboo_cur_msp = NULL; - smemflag = true; - bamboo_smem_zero_top = NULL; - } + // Zero out the remaining memory here because for the GC_CACHE_ADAPT + // version, we need to make sure during the gcinit phase the shared heap + // is not touched. Otherwise, there would be problem when adapt the cache + // strategy. + bamboo_smem_size = 0; + bamboo_cur_msp = NULL; + smemflag = true; + bamboo_smem_zero_top = NULL; } INLINE void processmsg_gcstartinit_I() { diff --git a/Robust/src/Runtime/mem.c b/Robust/src/Runtime/mem.c index bc5216fa..1e2e1a5f 100644 --- a/Robust/src/Runtime/mem.c +++ b/Robust/src/Runtime/mem.c @@ -6,6 +6,9 @@ #ifdef MULTICORE_GC #include "bambooalign.h" +#include "multicoremem.h" +#include "multicoregarbage.h" + extern volatile bool gcflag; void * mycalloc_share(struct garbagelist * stackptr, int size) {