Competitive analysis of the LRFU paging algorithm - PowerPoint PPT Presentation

1 / 29
About This Presentation
Title:

Competitive analysis of the LRFU paging algorithm

Description:

Haim Kaplan -- Tel Aviv Univ. Uri Zwick -- Tel Aviv Univ. 2. Online paging problem ... You have a cache with k slots. if p cache you get a hit. ... – PowerPoint PPT presentation

Number of Views:55
Avg rating:3.0/5.0
Slides: 30
Provided by: ibm120
Category:

less

Transcript and Presenter's Notes

Title: Competitive analysis of the LRFU paging algorithm


1
Competitive analysis of the LRFU paging algorithm
  • Edith Cohen -- ATT
  • Haim Kaplan -- Tel Aviv Univ.
  • Uri Zwick -- Tel Aviv Univ.

2
Online paging problem
Get requests to pages
You have a cache with k slots
Upon a request for page p
if p ? cache you get a hit. Otherwise you have to
put p into the cache and you get a miss
Want to minimize the miss rate
3
LRU and LRU
LRU Evicts the Least Recently Used page
4
LRU and LRU
LRU Evicts the Least Recently Used page
5
LRU and LRU
LRU Evicts the Least Recently Used page
LFU Evicts the Least Frequently Used page
6
Competitive analysis
miss rate (A)
On the worst-case sequence
competitive ratio (A)

miss rate (OPT)
competitive ratio(LRU) k
competitive ratio(LFU) unbounded
Both are good in practice.
Borodin, El Yaniv Is there a natural algorithm
that has a finite competitive ration which is
less than k ?
7
LRFU? (Lee,Choi,Kim,Noh,Min,Cho,Kim
Sigmetrics99)
Each page p in the cache has a value v(p)
Upon a request for a page q we do the following
(a) For every p ? cache v(p) ? ?v(p)
(b) If q ? cache we evict the page with smallest
value. We put q in with v(q) 1. If q ?
cache v(q) 1 v(q).
? 1 gt LRFU1 LFU
8
LRFU
1
2
Each page p in the cache has a value v(p)
Upon a request for a page q we do the following
(a) For every p ? cache v(p) ? v(p)
(b) If q ? cache we evict the page with smallest
value. We put q in with v(q) 1. If q ?
cache v(q) 1 v(q).
By induction v(q) lt 2 and older pages have values
smaller than 1 (ordered by most recent request).
Therefore LRFU
LRU
1
2
9
LRFU
3
4
10
LRFU
3
4
11
LRFU
3
4
7
4
12
LRFU
3
4
7
4
13
LRFU
3
4
37
16
14
LRFU
3
4
37
16
15
LRFU
3
4
111
64
16
LRFU
3
4
111
64
17
LRFU
3
4
3
192

4
256
333
256
18
LRFU
3
4
1
3
192

4
256
333
256
19
LRFU
3
4
1
3
192

4
256
333
256
20
LRFU
3
4
3
4
3
192

4
256
333
3

256
4
21
LRFU
3
4
22
LRFU
3
4
23
LRFU
3
4
7
4
24
LRFU
3
4
7
4
25
LRFU
3
4
21
16
26
LRFU
3
4
21
16
27
LRFU
3
4
3
4
63
64
28
LRFU
3
4
1
3
4
63
64
29
LRFU
3
4
1
3
4
63
64
30
LRFU
3
4
3
4
3
3

4
4
63
3

64
4
31
LRFU
3
4
3
4
1
63
3

64
4
32
LRFU
3
4
3
4
1
63
3

64
4
33
LRFU
3
4
9
16
3
4
1
34
Observations
If we request the page over and over again its
value approaches
1 ? ?2 ?3 ?4
If a page has not been requested within the last
j requests than its value is smaller than
?j ?(j1) ?(j3)

?j
35
Our result
Let L be an integer such that
?L
gt 1
But,
?L1
? 1
Theorem The competitive ratio of LRFU? is k
L .
36
Proof (upper bound). Partition the sequence into
phases.
...
OPT gets at least one miss in each phase
37
Proof (upper bound).
Consider the cache after request L1 (in a
phase), for each p ? cache not yet requested in
the phase
?L1
v(p) lt
? 1
When there are no more pages unrequested since
the beginning of the page, phase ends
So each page that gets into the cache after
request L stays there until the end of the phase.
gt at most L k misses in a phase
38
Proof (lower bound).
We show a sequence such that LRFU misses kL
times for every miss of OPT
39
Proof (lower bound).
Idea Assume there are k1 pages Pumps up v(p),
by requesting it over and over again until
? ?- (L1)
?-L lt v(p) lt
and for every other page pi, v(pi) lt 1.
Now request the page not in LRFUs cache,
(OPT evicts p), and keep requesting the page not
in LRFUs cache. The first L such requests p
still has the largest value, then p becomes the
second largest, etc, until it gets evicted by
LRFU. Repeat this over and over again.
40
Proof (lower bound).
LRFUs cache
p, p2,p3,..pk
p, pk1 p2,p3,..
OPT evicts p
p, pk pk1 p2,p3,..
p, pk-L2... pk pk1 p2,p3,..
pk-L1 p, pk-L2... pk pk1 p2,p3,..
In k-1 more steps p is out
41
Open problems
LRFU proves practically useful, LCKNMCK 99.
For which sequences LRFU performs better than LRU
and LFU ?
Write a Comment
User Comments (0)
About PowerShow.com