Download presentation
Presentation is loading. Please wait.
Published byLindsey Bradford Modified over 9 years ago
1
Minimizing Cache Usage in Paging Alejandro López-Ortiz, Alejandro Salinger University of Waterloo
2
Outline Paging Paging with cache usage Interval Scheduling Online algorithms Simulations Conclusions 2
3
Paging 3 Slow memory Cache of size k …p 6 p 3 p 2 p 4 p 4 p 2 p 10 p 11 p 5 p 4 …Page requests Is p i in the cache? -Yes Goal: minimize number of faults Traditional cost model Hit: 0 Fault: 1 Hit -No Fault Fetch p i from slow memory, evict one page from cache
4
Paging Common eviction policies: Least Recently Used (LRU) First In First Out (FIFO) Flush When Full (FWF) Furthest In The Future (FITF) (offline) Marking and conservative algorithms are k-competitive 4
5
Paging with Cache Usage 5
6
fault cost cell cost 6
7
Applications Shared cache multiprocessors 7
8
Applications Shared cache multiprocessors Cooperative caching 8
9
Applications Energy efficient caching Content Addressable Memories (CAMs) 1 14 5 3 8 7 13 9 11 10 15 24 4 18 21 30 17 22 19 2 Cache 3 9
10
Applications Energy efficient caching Content Addressable Memories (CAMs) Power of search proportional to valid cells 15 3 8 7910 15 24 4 30222 Cache 3 10
11
Related Cost Models 11
12
Related Cost Models Buying Cache Model [Csirik et al. 01] Algorithm may purchase cache at cost c(x) Cost = faults + purchased cache No limit on purchased cache No returns 12
13
Paging as Interval Scheduling 13
14
Interval Scheduling 12341135234512 12341135234512 14
15
Offline Optimum 15 12341135234512
16
Online Algorithms 16
17
Online Algorithms 17
18
Online Algorithms p Not quite… 18
19
For any conservative or marking A k = 10 19
20
20
21
21
22
Locality of Reference L = Average length of phase in k-phase partition k = 10 L = 150 22
23
Simulations 23
24
Cost Ratio k=5 24
25
Cost Ratio k=7 25
26
Faults 26
27
Average Cache Usage 27
28
Conclusions Introduced Minimum Cache Usage problem Cost-sensitive family of online algorithms 2 ≤ CR(α) ≤ k 2-competitive for sequences with high locality Polynomial time optimal offline algorithm Algorithms are competitive in practice Future Work: Deeper lower bound analysis Other online algorithms Applications, e.g., shared cache cooperative strategy Thank you 28
29
k = 10 29
30
Paging 3 1 14 5 3 8 7 13 9 11 10 15 24 4 18 21 30 17 22 19 2 3 Cache Memory Hit! Memory 30
31
Paging 6 1 14 5 3 8 7 13 9 11 10 15 24 4 18 21 30 17 22 19 2 Fault! Cache Memory 6 6 31
32
Paging Input: sequence of page requests cache size k Paging algorithm = eviction policy What page should be evicted from the cache? Traditional cost model Hit: 0 Fault: 1 Goal: minimize the number of faults 32
33
Competitive Analysis 33
34
Paging Models Page has fault cost and size Page fault (classic) model Uniform size and fault costs Weighted caching [Chrobak 91] Varying fault costs, uniform page sizes Fault model [Irani 97] Varying sizes, uniform fault cost Bit model [Irani 97] Fault cost equals size General [Young 98] k-competitive algorithms for all above Offline problem is NP-hard 34
35
Paging Models 35
36
…,3,3,4,5,21,3,4,17,5,3,5,5,6,7,8, ??? Offline Optimum But paging is an online problem! Offline algorithm can lead to good online algorithms Classic paging optimum: FITF LRU …,3,3,4,5,21,3,4,17,5,3,5,5,6,7,8,9,6,7,4,4,5,3,15,13,3,3,7,8,9,… 8,7,6,5,5,3,5,17,4 36
37
Interval Scheduling 12341135234512 12341135234512 37
38
Interval Scheduling 12341135234512 38
39
Interval Scheduling 12341135234512 39
40
Offline Optimum 40
41
Offline Optimum 41 12341135234512
42
Online Algorithms Marking algorithm: at most k faults in each phase LRU, FWF, CLOCK Conservative algorithm: at most k faults LRU, FIFO, CLOCK ≤ k distinct pages ≤ k 42
43
OPT 43
44
44
45
45
46
46
47
47
48
Faults k=7 48
49
Average Cache Usage k=7 49
50
…1234561234… 50
51
43167589206231 k = 9 51
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.