From e5a109d17b74c1d3fa614282c6d4c83d3cad54f2 Mon Sep 17 00:00:00 2001 From: adash Date: Wed, 23 Sep 2009 01:20:55 +0000 Subject: [PATCH] add "count of Prefetch response" into stats small inline changes that yeild some benefit A good number to play around is the size of the prefetch threshold that initiates a garbage collection. --- Robust/src/IR/Flat/BuildCode.java | 2 ++ Robust/src/Runtime/DSTM/interface/gCollect.h | 2 +- Robust/src/Runtime/DSTM/interface/llookup.c | 2 +- Robust/src/Runtime/DSTM/interface/llookup.h | 2 ++ Robust/src/Runtime/DSTM/interface/prelookup.c | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 7a001e29..8360a637 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -375,6 +375,7 @@ public class BuildCode { outmethod.println("printf(\"nmhashSearch= %d\\n\", nmhashSearch);"); outmethod.println("printf(\"nprehashSearch= %d\\n\", nprehashSearch);"); outmethod.println("printf(\"nRemoteReadSend= %d\\n\", nRemoteSend);"); + outmethod.println("printf(\"getResponse= %d\\n\", getResponse);"); outmethod.println("printf(\"bytesSent= %d\\n\", bytesSent);"); outmethod.println("printf(\"bytesRecv= %d\\n\", bytesRecv);"); } else if (state.SINGLETM) { @@ -901,6 +902,7 @@ public class BuildCode { outclassdefs.print("extern int nmhashSearch;\n"); outclassdefs.print("extern int nprehashSearch;\n"); outclassdefs.print("extern int nRemoteSend;\n"); + outclassdefs.print("extern int getResponse;\n"); outclassdefs.print("extern int bytesSent;\n"); outclassdefs.print("extern int bytesRecv;\n"); outclassdefs.print("extern void handle();\n"); diff --git a/Robust/src/Runtime/DSTM/interface/gCollect.h b/Robust/src/Runtime/DSTM/interface/gCollect.h index 747e987f..194080d4 100644 --- a/Robust/src/Runtime/DSTM/interface/gCollect.h +++ b/Robust/src/Runtime/DSTM/interface/gCollect.h @@ -13,7 +13,7 @@ // will fail in odd subtle ways #define DEFAULT_OBJ_STORE_SIZE (4194304-16) //just a little less the 4MB -#define PREFETCH_FLUSH_THRESHOLD 10 //MINIMUM SIZE BEFORE FLUSHING +#define PREFETCH_FLUSH_THRESHOLD 20 //MINIMUM SIZE BEFORE FLUSHING #define STALL_THRESHOLD 15 //number of prefetches stores before we can start freeing old ones diff --git a/Robust/src/Runtime/DSTM/interface/llookup.c b/Robust/src/Runtime/DSTM/interface/llookup.c index ec49a90a..4f39f11e 100644 --- a/Robust/src/Runtime/DSTM/interface/llookup.c +++ b/Robust/src/Runtime/DSTM/interface/llookup.c @@ -22,7 +22,7 @@ unsigned int lhashInsert(unsigned int oid, unsigned int mid) { return 0; } -unsigned int lhashSearch(unsigned int oid) { +INLINE unsigned int lhashSearch(unsigned int oid) { if (oidsPerBlock == 0) return hostIpAddrs[0]; else diff --git a/Robust/src/Runtime/DSTM/interface/llookup.h b/Robust/src/Runtime/DSTM/interface/llookup.h index 3f9f44c7..f8266d9f 100644 --- a/Robust/src/Runtime/DSTM/interface/llookup.h +++ b/Robust/src/Runtime/DSTM/interface/llookup.h @@ -10,6 +10,8 @@ #define LOADFACTOR 0.5 #define HASH_SIZE 100 +#define INLINE inline __attribute__((always_inline)) + typedef struct lhashlistnode { unsigned int oid; unsigned int mid; diff --git a/Robust/src/Runtime/DSTM/interface/prelookup.c b/Robust/src/Runtime/DSTM/interface/prelookup.c index 3fc1ea18..8c09c101 100644 --- a/Robust/src/Runtime/DSTM/interface/prelookup.c +++ b/Robust/src/Runtime/DSTM/interface/prelookup.c @@ -70,7 +70,7 @@ void prehashInsert(unsigned int key, void *val) { } // Search for an address for a given oid -void *prehashSearch(unsigned int key) { +INLINE void *prehashSearch(unsigned int key) { int index; prehashlistnode_t *ptr, *node; -- 2.34.1