Improve The Performance of LRU Page Replacement Algorithm Using Augmentation of Data Structure
Improve The Performance of LRU Page Replacement Algorithm Using Augmentation of Data Structure
Abstract— The process takes less time for handling instructions Step 2: Determine the additional information needed for
then would be speedy and efficient. The speed of the process is more functionality.
not only depends on architectural features and operational
frequency, but also depends on the algorithm and data structure, Step 3: Verify that we can maintain existing operation of
which is used for that process. There are many page replacement data structure
algorithms such as least recently used (LRU), first-in-first-out Step 4: Develop a new operations.
(FIFO), Optimal and the combination of LRU and least
frequently used (LFU) are available in memory management. We For augmentation of data structure, we are not blindly
can improve the performance of page replacement algorithm following the above steps. Most of the work includes trial and
either develop a new algorithm from scratch or using error. In augmented data structures we have to check it increase
augmentation of data structure and algorithm design. In this the performance or not [11],[14].
paper we use augmented doubly circular link list, skip list, splay
tree and hash table and apply all these on LRU page replacement In this paper we choose four data structure for augmentation:
algorithm. We implement all these augmented data structure doubly circular link list, skip list, splay tree and hash table.
with LRU page replacement algorithm and traced using Here, we augmented these data structures according to LRU
Standard Performance Evaluation Corporation (SPEC) page replacement algorithm. So, our goal is to improve the
benchmark files. This paper show that augmentation of data performance of LRU page replacement algorithm using these
structure can improve the performance of LRU page augmented data structure.
replacement algorithm.
The remainder of this paper organized as follow: in the next
Keywords- page replacement; data structure; augmentation; section we review the background work. In Section III, we
least recently used; weighting replacement policy; discuss about the augmentation of doubly circular link list, skip
list, splay tree and hash table. Section IV contains the proposed
I. INTRODUCTION replacement scheme using augmented data structure. In section
V, we include the simulation results and its analysis. And the
Efficient page replacement algorithm reduced the gap last section VI contains the conclusion and future work.
between processor and the memory. There are many page
replacement algorithms are available such as first-in-first-out
(FIFO), optimal, least recently used (LRU), least frequently II. BACKGROUND WORK
used (LFU), random and so on. But, what is the performance of In the design of page replacement algorithm people have
this all page replacement algorithm [1],[2]. Every page focused on the computational time and ignored I/O time.
replacement algorithm performs main three operations: There is a large difference in access time of fast main
inserting a page, delete a page and search a page. All these memory and slow external memory such as disk. Access time
operations are depends on the data structure used as a page of disk measure in milli seconds and access time of the main
table. And the scheme and complexity of every data structure memory measure in nano seconds. So there is a factor of
are different. Therefore, efficient data structure may improve millions in difference in the access time of main memory and
the performance of page replacement algorithm [3]. disk [11],[13]. Therefore if the page is accessed from main
memory called hit, it takes minimum time; otherwise called
The main problem in data structure is that all the efficient miss and it take more time.
data structure may not fulfill our needs. For that we have to
modify the data structure based on our needs. We can modify An application where the amount of data manipulation is
the data structure by adding additional information called data too large than main memory such as computer graphics, VLSI
augmentation. Below are the steps to augment the data verification, computational biology, database system ans so
structure [14]: on. And NASA‟s EOS project, which is expected to
manipulate peta bytes (thousand of tera bytes) of data! [11]
Step 1: choose an underlying data structure Threfore if we increase the hit or hit ratio, we can reduce the
access time [6],[9],[12].
LRU page replacement algorithm observe that most heavily Here, node consists of page address and two pointers: one
used page in last few instruction have a chance to used in the pointing to previous page and other pointing to next page
next few instructions. When a page is faulted in LRU, it shown in figure 2.
replaces the page that has been not used for longest time. The
combination of LRU and LFU performed better than other
replacement policy such as weighting replacement policy B. Augmentation of Skip List
(WRP), least recently frequently (LRFU), second-chance After implemented self-adjustable doubly circular link list,
frequency least recently used (SF-LRU) etc [5],[7],[8],[10]. we analyzed that if we consider only recency index in self-
adjustable doubly circular link list. But, if we consider recency
In the Linux, LRU and tree with three levels page table is and frequency parameter, then what will be the output of the
used: page directory, page middle directory and page table LRU page replacement algorithm. For this purpose, we
entries. Each layered implemented using the array. In this paper augment the skip list and consider both recency and frequency
we implements LRU with augmented doubly circular link list, index. In augmented skip list, we used self-adjustable circular
skip list, splay tree and hash table toward improve the link list as a layered list [18].
performance [11], [15].
In augmented skip list, a node consists of a page address,
III. AUGMENTATION OF DATA STRUCTURES page frequency and two pointers: one is pointing to previous
and another is pointing to next page or node. In our method, we
A. Augmentation of Doubly Circularlink list store page address shown in figure 3. And the node for level in
the Skip List consist of a level frequency and three pointers,
In doubly circular link list we apply the move-to-front upper pointing to its upper layer, lower pointing to its lower
(MTF) self heuristic method to design the LRU page level and first element address pointing to its first node of
replacement algorithm. Self arrangement improves the average their layer shown in figure 3.
access time in the link list. The goal of this augmentation in
doubly circular link list is to improve efficiency of linear
search [17].
MTF method moves the most recently accessed element to
the head of the link list shown in figure 1. So, all the most
recently accessed nodes are available at the head of the link list
for future access.
Figure 3. (a) Node structure of skip list, (b) Node structure of skip list level
Figure 7. (a) Zig: terminating single rotation. (b) Zig-zig: two single rotation
(c) Zig-zag: double rotation [4]
specified location in hash table using hash function is called C. Augmentation of Splay Tree
hashing. There are many hashing techniques are available such Step 1: search page table for page p.
as division method, multiplication method, mid-square method, Step 2: if page p is available then assign current value of
digit folding method etc. In our application we used division
frequency to page p‟s turn and moves page p to the root of the
method of hashing [16].
splay tree. Increase the hit counter and frequency by 1 and exit;
If a key is uniformly distributed, then value stored in hash otherwise increase the miss counter by 1 and go to step 3.
table can be searched in O (1) time using this hash function in Step 3: if free space available in page table then insert page p
average case. into the splay tree and assign current value of frequency to
Like splay tree, we modified our hash table by adding turn newly inserted page‟s turn. Otherwise go to step 4.
information associated with every element. The node Step 4: I) delete the page with minimum turn value and
structure of hash table is shown in figure 8. II) Insert the page p into the splay tree and assign
current value of frequency to page p’s turn.
D. Augmentation of Hash Table
Step 1: apply hash function on page p and obtain the array
index
Figure 8. Node structure of hash table
Step 2: if the value of generated array index is null, then
I) insert the page p at this index and assign current value
Every time when insert operation is performed, we store of frequency to page p‟s turn. And increase frequency
the current value of turn to its associate counter. When page and miss counter by 1.
table is full, then we must have to remove least recently used II) Increase counter by 1 and exit. Otherwise go to step
(LRU) element. For eviction, find the element with lowest turn 3.
value in hash table. Every time when page is hit, we just Step 3: Then search the list that is associated with array index.
increment the value of turn. Step 4: if page p is available then assign current value of
frequency to page p„s turn. And increase hit counter and
IV. PROPOSED REPLACEMENT SCHEME frequency by 1 and exit; otherwise increase miss counter by 1
and go to step 5.
In this section we design the scheme of LRU page
replacement algorithm with augmented doubly circular link Step 5: if free space is available in page table, then
list, skip list, splay tree and hash table. I) Insert the page p at this index and assign current value
of frequency to page p‟s turn.
A. Augmentation of Doubly Circularlink list II) And increase frequency by 1 and exit. Otherwise go
to step 6.
Step 1: search page table for page p. Step 6: I) delete the page with lowest turn value then
Step 2: if page is available then moves page p to the head of II) Insert the page p at this index and assign current
the self-adjustable doubly circular link list. Increase hit counter value of frequency to page p's turn.
by one and exit; otherwise increase miss counter by 1 and go to III) Increase frequency by 1 and exit.
step 3.
Step 3: if free space in page table then insert page p to the head V. SIMULATION AND RESULT ANALYSIS
of the link list otherwise go to step 4
Step 4: I) delete the page from the tail of the link list then A. Data set
II) Insert the page p at the head of the link list We used following two traces: gcc and swim to simulate
B. Augmentation of Skip List our algorithm. Each one trace file is a real recording running
program, taken from the SPEC benchmarks. It contains
Step 1: search page table for page p. hexadecimal address of a process. We considered 10 different
Step 2: if page p is available then increment its page page table sizes and run the simulator program to test the
frequency. Increase the hit counter by 1 and go to step 3; performance of our proposed algorithm.
otherwise increase the miss counter by 1 and go to step 5.
Step 3: if the frequency of page p is greater than level B. Simulation Results
frequency then moves page p to the head of its upper layer; Simulation results are the average of the result obtains after
otherwise go to step 4. running same parameter 10 times for each. Here we are
Step 4: move page p to the head of the current layer and exit. compared the result of existing weighting replacement policy
Step 5: if free space in page table then insert page p to the head (WRP) with our augmented data structure algorithms.
of the bottom layer of skip list otherwise go to step 6.
Step 6: I) delete the page from the tail of the bottom layer of Augmented link list with LRU is 26.47%, augmented skip
skip list then list with LRU is 12.41%, augmented splay tree with LRU is
II) Insert the page p at the head of the bottom layer of 18.26% and augmented hash table with LRU is 30.86% better
than existing WRP algorithm.
skip list.
REFERENCES
[1] Abraham Silberschatz, Peter B. Galvin and Greg Gagne, ”Memory
Management Strategies” in Operating System Concept,8th ed. Wiley
Student Edition, pp. 315-417.
[2] Andrew S. Tanenbaum, “Memory Management,” in Modern Operating
Systems,3rd ed. New Delhi, Pearson Prentice Hall, 2009, ch. 3, pp. 175-
248.
Figure 9. Comparison of hit ratio between WRP and augmented data
structure using gcc trace file [3] C.C.Kavar and S.S. Parmar, “Performance Analysis of LRU Page
Replacement Algorithm with Reference to Different Data Structure,”
IJERA, 2013, Vol. 3, Issue 1, pp. 2070-2076.
[4] Daniel Dominic Sleator and Robert Endre Tarjan, “Self-Adjusting
Binary Search Trees,” Journal of the Association for Computing
Machinery. Vol. 32, No. 3, July 1985, pp. 652-686.
[5] Debabala Swain, Bijay Paikaray and Debabrata Swain, “AWRP:
Adaptive Weight Ranking Policy for Improving Cache Performance,"
Journal of Computing, Volume 3, February 2011.
[6] Debabrata Swain, Bancha Nidhi Dash, Debendra O Shamkuwar,
Debabala Swain,” Analysis and Predictability of Page Replacement
Techniques towards Optimized Performance”, IRCTITCS, pp. 12-16.J.
Clerk Maxwell, A Treatise on Electricity and Magnetism, 3rd ed., vol. 2.
Oxford: Clarendon, 1892, pp.68–73.
[7] Donghee Lee, Jongmoo Choi, Jong-Hun Kim, Sam H. Noh, Sang Lyul
Min, Yookun Cho and Chong Sang Kim, “LRFU: A Spectrum of
Figure 10. Comparison of hit ratio between WRP and augmented data Policies that Subsumes the Least Recently Used and Least Frequently
structures using swim trace file Used Policies,” IEEE Transactions on Computers, vol. 50, no. 12, Dec,
2001, pp. 1352-1360.
[8] Jaafar Alghazo, Adil Akaaboune and Nazeih Botros,“SF-LRU Cache
Replacement Algorithm,” MTDT IEEE Conference, 2004.
[9] Kaveh Samiee,”A Replacement Algorithm Based on Weighting and
Ranking Cache,” International Journal of Hybrid Information
Technology, vol.2, April, 2009, pp. 93-103
[10] Kaveh Samiee and GholamAli Rezai Rad, “WRP: Weighting
Replacement Policy to Improve Cache Performance,” International
Journal of Hybrid Information Technology, vol.2, 2009.
[11] Lars Arge, ”Efficient External-Memory Data Structures and
Applications,” Ph.D. dissertation, faculty of science, university of
Aarhus, Denmark, Feb 1996.
[12] S.M.Shamsheer Daula, Dr. K.E. Sreenivasa Murthy and G amjad Khan,
“A Throughput Analysis on Page Replacement Algorithms in Cache
Memory Management,” IJERA, vol. 2, pp. 126-130,March-April 2012.
Figure 11. Average comparison of hit ration between WRP and augmented [13] Theodore Johnson and Dennis Shasha, “2Q: A Low Overhead High
data structures Performance Buffer Management Replacement Algorithm,”
Proceedings of the 20th VLDB Conference Santiago, Chile, 1994.
[14] Thomas H.Corman, Charles E. Leiserson et al., Introduction to
VI. CONCLUSION AND FUTURE WORK Algorithms, 3rd ed. PHI publication, 2010.
In this paper we use augmented doubly circular link list, [15] Yannis Smaragdakis, Scott Kaplan and Paul Wilson,”The EELRU
Adaptive replacement algorithm,” Elsevier, Performance Evaluation 53,
skip list, splay tree and hash table and apply all these on LRU 2003, pp. 93-123.
page replacement algorithm. We implement all these [16] Wikipedia, (2013, Feb 19). Hash table [Online]. Available:
augmented data structure with LRU page replacement http://en.wikipedia.org/wiki/Hash_table
algorithm and traced using Standard Performance Evaluation [17] Wikipedia, (2013, Feb 19). Self-Organizing list [Online]. Available:
Corporation (SPEC) benchmark files. http://en.wikipedia.org/wiki/Self-organizing_list
[18] Wikipedia, (2013, Feb 19). Skip list [Online]. Available:
We can improve the page replacement algorithm using the http://en.wikipedia.org/wiki/Skip_list
concept of data augmentation instead of develop a new
[19] Wikipedia, (2013, Feb 19). Splay tree [Online]. Available:
algorithm from scratch. http://en.wikipedia.org/wiki/Splay_tree