BAMBOO_DEBUGPRINT(0xcdce);
BAMBOO_DEBUGPRINT_REG(orig->ptr);
BAMBOO_DEBUGPRINT_REG(to->ptr);
- BAMBOO_DEBUGPRINT_REG(isize);
+ BAMBOO_DEBUGPRINT_REG(isize);
#endif
gccurr_heaptop -= isize;
to->ptr += isize;
int hotestcore = 0;
int hotfreq = 0;
+ int *local_tbl=&gccachesamplingtbl_r[page_index];
for(int i = 0; i < NUMCORESACTIVE; i++) {
- int * local_tbl = (int *)((void *)gccachesamplingtbl_r
- +size_cachesamplingtbl_local_r*i);
- int freq = local_tbl[page_index]/BAMBOO_PAGE_SIZE;
- // TODO
+ int freq = *local_tbl;
+ local_tbl=(int *)(((char *)local_tbl)+size_cachesamplingtbl_local_r);
+
// check the freqency, decide if this page is hot for the core
if(hotfreq < freq) {
hotfreq = freq;
int totalfreq = 0;
int hotfreq = 0;
+ int *local_tbl=&gccachesamplingtbl_r[page_index];
for(int i = 0; i < NUMCORESACTIVE; i++) {
- int * local_tbl = (int *)((void *)gccachesamplingtbl_r
- +size_cachesamplingtbl_local_r*i);
- int freq = local_tbl[page_index]/BAMBOO_PAGE_SIZE;
+ int freq = *local_tbl;
+ local_tbl=(int *)(((char *)local_tbl)+size_cachesamplingtbl_local_r);
totalfreq += freq;
// TODO
// check the freqency, decide if this page is hot for the core
hotestcore = i;
}
}
+
// Decide the cache strategy for this page
// If decide to adapt a new cache strategy, write into the shared block of
// the gcpolicytbl
// this page has not been accessed, do not change its cache policy
continue;
}
- totalfreq = (totalfreq*GC_CACHE_ADAPT_DOMINATE_THRESHOLD)/100;
+ totalfreq = (totalfreq*GC_CACHE_ADAPT_DOMINATE_THRESHOLD)/100/BAMBOO_PAGE_SIZE;
if(hotfreq < totalfreq) {
// use hfh
policy.cache_mode = BAMBOO_CACHE_MODE_HASH;
int totalfreq = 0;
int hotfreq = 0;
+ int *local_tbl=&gccachesamplingtbl_r[page_index];
for(int i = 0; i < NUMCORESACTIVE; i++) {
- int * local_tbl = (int *)((void *)gccachesamplingtbl_r
- +size_cachesamplingtbl_local_r*i);
- int freq = local_tbl[page_index]/BAMBOO_PAGE_SIZE;
+ int freq = *local_tbl;
+ local_tbl=(int *)(((char *)local_tbl)+size_cachesamplingtbl_local_r);
totalfreq += freq;
// TODO
// check the freqency, decide if this page is hot for the core
// this page has not been accessed, do not change its cache policy
continue;
}
+
+ totalfreq/=BAMBOO_PAGE_SIZE;
// locally cache the page in the hotest core
// NOTE: (x,y) should be changed to (x+1, y+1)!!!
policy.cache_mode = BAMBOO_CACHE_MODE_COORDS;
int totalfreq = 0;
int hotfreq = 0;
+ int *local_tbl=&gccachesamplingtbl_r[page_index];
for(int i = 0; i < NUMCORESACTIVE; i++) {
- int * local_tbl = (int *)((void *)gccachesamplingtbl_r
- +size_cachesamplingtbl_local_r*i);
- int freq = local_tbl[page_index]/BAMBOO_PAGE_SIZE;
+ int freq = *local_tbl;
+ local_tbl=(int *)(((char *)local_tbl)+size_cachesamplingtbl_local_r);
totalfreq += freq;
// TODO
// check the freqency, decide if this page is hot for the core
// this page has not been accessed, do not change its cache policy
continue;
}
+ totalfreq/=BAMBOO_PAGE_SIZE;
// locally cache the page in the hotest core
// NOTE: (x,y) should be changed to (x+1, y+1)!!!
policy.cache_mode = BAMBOO_CACHE_MODE_COORDS;