Skip to content

Commit

Permalink
fix a problem where corr-window=0 is not the same as S3FIFOv2;
Browse files Browse the repository at this point in the history
change the default corr_window_ratio to 0.5
  • Loading branch information
1a1a11a committed May 29, 2024
1 parent 50bfac5 commit e44714e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions libCacheSim/cache/eviction/Cloud2QPlus.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ typedef struct {

static const char *DEFAULT_CACHE_PARAMS =
"fifo-size-ratio=0.10,ghost-size-ratio=0.90,move-to-main-threshold=2,"
"corr-window-ratio=0.0";
"corr-window-ratio=0.5";

// ***********************************************************************
// **** ****
Expand Down Expand Up @@ -241,9 +241,8 @@ static cache_obj_t *Cloud2QPlus_find(cache_t *cache, const request_t *req,
if (obj != NULL) {
int time_since_insertion =
params->n_obj_admit_to_fifo - obj->Cloud2QPlus.insertion_time;
if (time_since_insertion >
if (time_since_insertion >=
params->fifo->cache_size * params->corr_window_ratio) {
// if (time_since_insertion <= params->fifo->cache_size)
obj->Cloud2QPlus.freq += 1;
}
return obj;
Expand Down

0 comments on commit e44714e

Please sign in to comment.