I wonder if it was meant to be "e->hits >>= 1;" - that would almost make sense with the comment.
Tuesday, January 20, 2015, 10:00:40 PM, you wrote: > Hi all, > I have a question about the tick function of RamCacheCLFUS, the code is : > ...... e->>hits <<= 1; if (e->>hits) { > e->hits = REQUEUE_HITS(e->hits); > lru[1].enqueue(e); > } else > goto Lfree; > ...... > I'm confused about the code, it doubles the hit number and then check if the > number is zero or not. What's the usage of the doubling ?? > It seems the implementation is not the same as the introduction of history > list > (http://nottheoilrig.com/trafficserver/201408290/arch/cache/ram-cache.en.html), > "Each CLOCK the least recently used entry in the History List is dequeued > and if the "hits" field is not greater than 1 (it was hit at least once in > the History or Cached List) it is deleted, otherwise the "hits" is set to > zero and it is requeued on the History List." > Am I missing something?? > Regards, > Huawei Technologies, China > Haojun Zhou