Task #4728
closedMake LRU the default cache replacement policy
100%
Description
Per discussion on Sep 5, 2018, the concept of freshness should not have any bearings on the replacement policies. Current implementation of replacement policies separates "fresh" and "non-fresh" packets and treats them differently, which is incorrect behavior and needs to be changed.
Updated by Junxiao Shi about 6 years ago
- Subject changed from Remote fresh/non-fresh queue in CS replacement policies to Remove fresh/non-fresh queue in CS replacement policies
While I agree with this direction in general, I disagree with modifying any existing policy. Instead, create a new simple "fifo" policy and make it default, and leave "priority_fifo" unchanged for those who need it.
The simple "fifo" also doesn't consider rarely-used unsolicited Data separately, so that it's significantly simpler and more performant.
Updated by Alex Afanasyev about 6 years ago
Sure. I agree with creating a new policy and making it a new default.
Updated by Chavoosh Ghasemi about 6 years ago
Sounds good to me, too. I will create a new cache replacement policy (probably named Fifo
or PureFifo
) where only has one queue with no priority for any Data packet.
Updated by Davide Pesavento about 6 years ago
What about the "lru
" policy? Does it distinguish between fresh and non-fresh Data? (and shouldn't it be the default rather than a pure FIFO policy?)
Updated by Chavoosh Ghasemi about 6 years ago
What about the "
lru
" policy? Does it distinguish between fresh and non-fresh Data? (and shouldn't it be the default rather than a pure FIFO policy?)
LRU does not use Freshness. So, it meets our requirements and can be the default replacement policy.
However, I think we need to have a pure version of Fifo, anyways, and between FIFO and LRU, I think FIFO replacement policy is considered the one with the basic functions, with no fancy mechanisms.
Updated by Alex Afanasyev about 6 years ago
LRU has nothing "fancy" while FIFO caching policy doesn't make much sense for any reasonable cache. So, I would strongly agree with Davide that LRU policy has to become a default, not FIFO (this was a copy of design from an ancient code).
Updated by Chavoosh Ghasemi about 6 years ago
FIFO caching policy doesn't make much sense for any reasonable cache
I am not sure what you exactly mean. FIFO and LRU are two different policies with their own pros and cons. It highly depends on the application that which one is better for it. FIFO (probably) is the simplest replacement policy (which is easier to analyze). This is the main reason I think FIFO is a better candidate to be the default one.
BTW, regardless of default policy, do we need the pure FIFO? Because I've already pushed the code to Gerrit.
Updated by Davide Pesavento about 6 years ago
- Status changed from New to Code review
Updated by Chavoosh Ghasemi about 6 years ago
Beichuan, thinks we do not need to implement FIFO replacement policy. I'll just make LRU the default replacement policy.
Updated by Chavoosh Ghasemi about 6 years ago
- Subject changed from Remove fresh/non-fresh queue in CS replacement policies to Make LRU the default cache replacement policy
Updated by Davide Pesavento about 6 years ago
- Status changed from Code review to Closed
- % Done changed from 0 to 100