Questions tagged [page-replacement]

44 questions
22
votes
1 answer

Virtual Memory Page Replacement Algorithms

I have a project where I am asked to develop an application to simulate how different page replacement algorithms perform (with varying working set size and stability period). My results: Vertical axis: page faults Horizontal axis: working set…
Jiew Meng
  • 84,767
  • 185
  • 495
  • 805
9
votes
0 answers

Replacing the Linux Kernel's Page Replacement Algorithm

I've been working on a kernel module that simulates a page replacement algorithm. It consists of a number of page replacement algorithms: FIFO, LRU, Clock, LFU that run concurrently each with it's own view of main memory and each with it's own page…
deborah-digges
  • 1,165
  • 11
  • 19
9
votes
3 answers

Understanding LRU Algorithm

I am trying to understand LRU and its making no sense to me. If I understand it then it will be easier for me to code. Can someone walk me through the steps? Like, If the reference string you are currently at is in the array then do you increment…
user249375
6
votes
4 answers

How does FIFO page replacement work?

I'm trying to understand the FIFO page replacement algorithm, but all the information I can find amounts to what's below. Can you explain how you use a reference string to evaluate a page replacement algorithm, using the particular example of FIFO?…
temporary_user_name
  • 35,956
  • 47
  • 141
  • 220
3
votes
1 answer

The mystery number '63' in the context of demand paging

I am running a code that mimics demand paging system here are some of the parameters: Page size = 4096 bits Processor = 32 bits Number of page frames = (variable) I run my code with a fifo or random page replacement algorithm with number of page…
moejoe
  • 145
  • 2
  • 11
3
votes
1 answer

active/inactive list in linux kernel

Where can I get active/inactive page lists inside Linux kernel which is maintained for memory management? Basically I want to dump these lists' info periodically, so I could understand which pages are active/inactive? Ultimate goal is to find which…
3
votes
1 answer

How can Belady's anamoly be avoided?

When we increase the number of frames to the process then the number of page fault should decrease but instead the page fault increase sometimes (Belady's anamoly). How this can be avoided?
3
votes
2 answers

Adaptive replacement cache algorithm

I'm trying to implement the Adaptative Replacement Cache algorithm but, i'm reading in the literature, and i can't understand the algorithm. Anyone can explain me that algorithm? I see that it use two lists L1 to the frequency and L2 to the…
PRVS
  • 1,612
  • 4
  • 38
  • 75
3
votes
2 answers

What is the difference between demand paging and page replacement?

From what I understand, demand paging is basically paging with swapping, so you can swap in a page when it is needed. But page replacement seems like more or less the same thing, where you bring in a page is needed and switching it with an existing…
3
votes
3 answers

Comparison of MFU and LRU page replacement algorithms

When does MFU (Most Frequently Used) page replacement algorithm have better performance than LRU (Least Frequently Used)? When is it worse than LRU? Where can I find information beyond the basic definition of the MFU page replacement algorithm?
Grisha
  • 305
  • 1
  • 4
  • 12
2
votes
2 answers

Is it possible for a FIFO page-replacement strategy to outperform LRU?

As part of my operating systems homework, I was asked to compare the number of page faults produced by first-in-first-out and least-recently-used page-replacement strategies for a given sequence of page accesses. Perplexingly, it appears that FIFO…
Evan Kroske
  • 4,506
  • 12
  • 40
  • 59
2
votes
1 answer

Page faults in LRU algorithm

I'm having trouble with understanding something from my programming lecture. I know that page replacement algorithms have page faults. In the LRU algorithm, when does a page fault occur? Is it when there are no more free frames left? Is it when a…
user3211186
  • 115
  • 2
  • 13
2
votes
1 answer

Clock Page Replacement Algorithm and FIFO

I wrote a simulation program of page replacement, where Clock algorithm (use 1 bit use bit) performs exactly same as FIFO, which makes me very confused. Here I have a simple case to replicate my difficulty: Say I have page 1 3 5 7 in memory, and…
Lingyuan He
  • 156
  • 2
  • 3
  • 8
1
vote
1 answer

Fifo page replacement infinite loop issue

I am trying to do page replacement algorithm in C. I wrote the code below. I have written similar code that had worked below. But now when I try to reproduce the code enters an infinite loop. I checked the for loop for hit and miss and it becomes…
JustaNobody
  • 150
  • 8
1
vote
1 answer

Explain CPU cache paging in FreeBSD, specifically paging queues

FreeBSD implements page coloring with paging queues. The queues are arranged according to the size of the processor’s L1 and L2 caches; and when a new page needs to be allocated, FreeBSD tries to get one that is optimally aligned for…
mawia
  • 9,169
  • 14
  • 48
  • 57
1
2 3