From 779b899ae8059a2b2f3f247771b155f6779ffe28 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Thu, 9 Apr 2009 00:02:23 +0000 Subject: [PATCH] annoying gc bug --- Robust/src/Runtime/STM/stm.c | 12 ++++++++++++ Robust/src/Runtime/STM/tm.h | 2 ++ Robust/src/Runtime/garbage.c | 6 +++--- Robust/src/Runtime/runtime.c | 4 ++++ Robust/src/Runtime/socket.c | 1 - 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Robust/src/Runtime/STM/stm.c b/Robust/src/Runtime/STM/stm.c index dc0dcfb6..1c6af83b 100644 --- a/Robust/src/Runtime/STM/stm.c +++ b/Robust/src/Runtime/STM/stm.c @@ -20,6 +20,8 @@ __thread struct objlist * newobjs; int numTransCommit = 0; int numTransAbort = 0; int nSoftAbort = 0; +int nSoftAbortCommit = 0; +int nSoftAbortAbort = 0; #endif @@ -191,12 +193,18 @@ void freenewobjs() { * ================================================================ */ int transCommit() { +#ifdef TRANSSTATS + int softaborted=0; +#endif do { /* Look through all the objects in the transaction hash table */ int finalResponse = traverseCache(); if(finalResponse == TRANS_ABORT) { #ifdef TRANSSTATS numTransAbort++; + if (softaborted) { + nSoftAbortAbort++; + } #endif freenewobjs(); objstrDelete(t_cache); @@ -206,6 +214,9 @@ int transCommit() { if(finalResponse == TRANS_COMMIT) { #ifdef TRANSSTATS numTransCommit++; + if (softaborted) { + nSoftAbortCommit++; + } #endif freenewobjs(); objstrDelete(t_cache); @@ -216,6 +227,7 @@ int transCommit() { if(finalResponse == TRANS_SOFT_ABORT) { #ifdef TRANSSTATS nSoftAbort++; + softaborted=1; #endif randomdelay(); } else { diff --git a/Robust/src/Runtime/STM/tm.h b/Robust/src/Runtime/STM/tm.h index 918cd9f3..8c231135 100644 --- a/Robust/src/Runtime/STM/tm.h +++ b/Robust/src/Runtime/STM/tm.h @@ -130,6 +130,8 @@ typedef struct newObjCreated { extern int numTransCommit; extern int numTransAbort; extern int nSoftAbort; +extern int nSoftAbortAbort; +extern int nSoftAbortCommit; #endif /* ================================ diff --git a/Robust/src/Runtime/garbage.c b/Robust/src/Runtime/garbage.c index 8f233fa4..875fa9de 100644 --- a/Robust/src/Runtime/garbage.c +++ b/Robust/src/Runtime/garbage.c @@ -22,7 +22,7 @@ #define NUMPTRS 100 -#define INITIALHEAPSIZE 128*1024*1024 +#define INITIALHEAPSIZE 16*1024*1024 #define GCPOINT(x) ((int)((x)*0.95)) /* This define takes in how full the heap is initially and returns a new heap size to use */ #define HEAPSIZE(x,y) ((int)(x+y))*2 @@ -286,8 +286,8 @@ void collect(struct garbagelist * stackptr) { if (c_table!=NULL) { fixtable(&c_table, c_size); fixobjlist(newobjs); - memorybase=NULL; } + memorybase=NULL; #endif /* Check current stack */ @@ -316,8 +316,8 @@ void collect(struct garbagelist * stackptr) { if ((*listptr->tc_table)!=NULL) { fixtable(listptr->tc_table, listptr->tc_size); fixobjlist(listptr->objlist); - (*listptr->base)=NULL; } + *(listptr->base)=NULL; #endif stackptr=listptr->stackptr; listptr=listptr->next; diff --git a/Robust/src/Runtime/runtime.c b/Robust/src/Runtime/runtime.c index 25ee0f81..cc422786 100644 --- a/Robust/src/Runtime/runtime.c +++ b/Robust/src/Runtime/runtime.c @@ -104,6 +104,10 @@ void CALL11(___System______exit____I,int ___status___, int ___status___) { printf("numTransCommit = %d\n", numTransCommit); printf("numTransAbort = %d\n", numTransAbort); printf("nSoftAbort = %d\n", nSoftAbort); +#ifdef STM + printf("nSoftAbortCommit = %d\n", nSoftAbortCommit); + printf("nSoftAbortAbort = %d\n", nSoftAbortAbort); +#endif #endif exit(___status___); } diff --git a/Robust/src/Runtime/socket.c b/Robust/src/Runtime/socket.c index 9adbd2e9..b82840e9 100644 --- a/Robust/src/Runtime/socket.c +++ b/Robust/src/Runtime/socket.c @@ -376,7 +376,6 @@ int CALL02(___Socket______nativeRead_____AR_B, struct ___Socket___ * ___this___, #endif int byteread=-1; - // printf("Doing read on %d\n",fd); do { byteread=read(fd, charstr, length); } while(byteread==-1&&errno==EINTR); -- 2.34.1