Task #4728
closed
Make LRU the default cache replacement policy
Added by Alex Afanasyev about 6 years ago.
Updated about 6 years ago.
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.
- 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.
Sure. I agree with creating a new policy and making it a new default.
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.
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?)
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.
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).
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.
- Status changed from New to Code review
Beichuan, thinks we do not need to implement FIFO replacement policy. I'll just make LRU the default replacement policy.
- Subject changed from Remove fresh/non-fresh queue in CS replacement policies to Make LRU the default cache replacement policy
- Status changed from Code review to Closed
- % Done changed from 0 to 100
Also available in: Atom
PDF