Project

General

Profile

Actions

Task #4728

closed

Make LRU the default cache replacement policy

Added by Alex Afanasyev over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Tables
Target version:
Start date:
09/05/2018
Due date:
% Done:

100%

Estimated time:

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.

Actions #1

Updated by Junxiao Shi over 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.

Actions #2

Updated by Alex Afanasyev over 6 years ago

Sure. I agree with creating a new policy and making it a new default.

Actions #3

Updated by Chavoosh Ghasemi over 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.

Actions #4

Updated by Davide Pesavento over 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?)

Actions #5

Updated by Chavoosh Ghasemi over 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.

Actions #6

Updated by Alex Afanasyev over 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).

Actions #7

Updated by Chavoosh Ghasemi over 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.

Actions #8

Updated by Davide Pesavento over 6 years ago

  • Status changed from New to Code review
Actions #9

Updated by Chavoosh Ghasemi over 6 years ago

Beichuan, thinks we do not need to implement FIFO replacement policy. I'll just make LRU the default replacement policy.

Actions #10

Updated by Chavoosh Ghasemi over 6 years ago

  • Subject changed from Remove fresh/non-fresh queue in CS replacement policies to Make LRU the default cache replacement policy
Actions #11

Updated by Davide Pesavento over 6 years ago

  • Status changed from Code review to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF