From: bdemsky Date: Wed, 22 Jun 2011 11:15:36 +0000 (+0000) Subject: bug fixes X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4d84e09c870e5d3c5608a52e052e26b02d9fb501;p=IRC.git bug fixes --- diff --git a/Robust/src/Runtime/bamboo/multicorecache.c b/Robust/src/Runtime/bamboo/multicorecache.c index 10ee1be1..061e96cd 100644 --- a/Robust/src/Runtime/bamboo/multicorecache.c +++ b/Robust/src/Runtime/bamboo/multicorecache.c @@ -154,7 +154,7 @@ void cacheAdapt_policy_dominate(int coren){ // use hfh //policy.cache_mode = BAMBOO_CACHE_MODE_HASH; unsigned int block = 0; - BLOCKINDEX(page_sva, &block); + BLOCKINDEX(block, (void *) page_sva); unsigned int coren = gc_block2core[block%(NUMCORES4GC*2)]; CACHEADAPT_POLICY_SET_HOST_CORE(policy, coren); } else { diff --git a/Robust/src/Runtime/bamboo/multicoregccompact.c b/Robust/src/Runtime/bamboo/multicoregccompact.c index 51a255a2..8084f83c 100644 --- a/Robust/src/Runtime/bamboo/multicoregccompact.c +++ b/Robust/src/Runtime/bamboo/multicoregccompact.c @@ -44,6 +44,7 @@ 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; @@ -93,15 +94,21 @@ void getSpaceRemotely(struct moveHelper *to, unsigned int minimumbytes) { } else { while(!gctomove) ; } - printf("B: %d\n", BAMBOO_NUM_OF_CORE); + printf("BX: %d\n", BAMBOO_NUM_OF_CORE); } else { - printf("C: %d\n", BAMBOO_NUM_OF_CORE); + 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 - while(!gctomove) ; - printf("D: %d\n", BAMBOO_NUM_OF_CORE); + 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); } //store pointer @@ -129,6 +136,8 @@ 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 { @@ -138,6 +147,7 @@ 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 @@ -149,6 +159,7 @@ 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); } } @@ -160,7 +171,6 @@ void compacthelper(struct moveHelper * orig,struct moveHelper * to) { } else { send_msg_4(STARTUPCORE,GCFINISHCOMPACT,BAMBOO_NUM_OF_CORE, 0, 0); } - } void * checkNeighbors_I(int corenum, unsigned INTPTR requiredmem, unsigned INTPTR desiredmem) { @@ -286,6 +296,7 @@ void * gcfindSpareMem_I(unsigned INTPTR requiredmem, unsigned INTPTR desiredmem, // If we cannot find spare mem right now, hold the request gcrequiredmems[requiredcore] = requiredmem; + maxusefulmems[requiredcore]=desiredmem; gcmovepending++; int count=gc_countRunningCores(); @@ -307,7 +318,6 @@ unsigned int compactblocks(struct moveHelper * orig, struct moveHelper * to) { void *origbound=orig->bound; unsigned INTPTR origendoffset=ALIGNTOTABLEINDEX((unsigned INTPTR)(origbound-gcbaseva)); unsigned int objlength; - while(origptrptr=toptr; + orig->ptr=origptr; + return 0; } void compact() { @@ -403,6 +416,7 @@ void master_compact() { compact(); /* wait for all cores to finish compacting */ tprintf("MASTER WAITING\n"); + while(!gc_checkCoreStatus()) ; diff --git a/Robust/src/Runtime/bamboo/multicoremsg.c b/Robust/src/Runtime/bamboo/multicoremsg.c index b2f1e869..c38bb04a 100644 --- a/Robust/src/Runtime/bamboo/multicoremsg.c +++ b/Robust/src/Runtime/bamboo/multicoremsg.c @@ -534,19 +534,12 @@ void processmsg_returnmem_I() { void * handlegcfinishcompact_I(int cnum, unsigned int bytesneeded, unsigned int maxbytesneeded) { if(bytesneeded > 0) { // ask for more mem - void * startaddr = gcfindSpareMem_I(bytesneeded, maxbytesneeded, cnum); - if(startaddr) { - // cache the msg first - return startaddr; - } else { - maxusefulmems[cnum]=maxbytesneeded; - gcrequiredmems[cnum]=bytesneeded; - } + return gcfindSpareMem_I(bytesneeded, maxbytesneeded, cnum); } else { //done with compacting gccorestatus[cnum] = 0; + return NULL; } - return NULL; } void processmsg_gcfinishcompact_I() {