• 100% Satisfaction Guarantee
Arty, Computer Support Specialist
Category: Computer
Satisfied Customers: 575
Experience:  SCSA, SCNA, 14 years in IT, DOS, Windows, Linux, FreeBSD, Solaris admin and software developer
31145473
Arty is online now

# Regarding Understanding Operating Systems - Ann Mciver bookhere

Regarding "Understanding Operating Systems"- Ann Mciver book
here is the exercise I have to complete:

1. Given that main memory is composed of three page frames for public use and that a program requests pages in the following order: D C B A D C E D C B A E
a. Using the FIFO page removal algorithm, do a page trace analysis indicating page faults with asterisks (*). Then compute the failure and success ratios.
b. Increase the size of memory so it contains four page frames for public use. Using the same page requests as above and FIFO, do another page trace analysisand compute the failure sucess ratios.
c. Did the result correspond with your intuition? Explain

Given that main memory is composed of three page frames for public use and that a program requests pages pages in the following order: A B A C A B D B A C D
A. Using the FIFO page removal algorithm, do a page trace analisys indicating page faults with asterisks. Compute failure & success ratio.
b. Using LRU page removal algorithm do a page trace analisys and compute the failute and success ratio.
c. why is better? can you make a general statement for this example? why or why not?
d. Let us define most recently used MRU as a page removal algorithm that removes from memory the most recently used page. Do a page trace analysis using the same page request as before anc compute the failures and sucess ratios
e. which of the three page removal algorithms is best and why u think so?

> a. Using the FIFO page removal algorithm, do a page trace analysis indicating page faults with asterisks (*). Then compute the failure and success ratios.

D C B A(*) D(*) C(*) E(*) D C B(*) A(*) E

What does it mean? SEE (it's example only, all the results below can be broken down the same way), here are steps 1)-12), and memory 'frame' content:
1) D
2) D C
3) D C B
*4) C B A // page fault, we remove D as it is first
*5) B A D // page fault, we remove C and append D
*6) A D C // page fault, we remove B and append C
*7) D C E // page fault, we remove A and append E
8) D C E // D already here
9) D C E // C already here
*10) C E B // page fault, remove D, append B
*11) E B A // page fault, remove C, append A
12) E B A // E is already here

failure/success ratio is: 6/6 = 1

b. Increase the size of memory so it contains four page frames for public use. Using the same page requests as above and FIFO, do another page trace analysis and compute the failure success ratios.

D C B A D C E(*) D(*) C(*) B(*) A(*) E(*)
failure/success ratio is: 6/6 = 1

c. Did the result correspond with your intuition? Explain

They didn't. I expect that it would be less page faults. But we have 6 page faults regardless of the frame size. It happens because the _order_ and number or page requests and frame size are not 'optimal' for FIFO algorithm (we have not the worst possible scenario but near).

> Given that main memory is composed of three page frames for public use and that a program requests pages pages in the following order: A B A C A B D B A C D

A. Using the FIFO page removal algorithm, do a page trace analysis indicating page faults with asterisks. Compute failure & success ratio.

A B A C A B D(*) B A(*) C D
failure/success ratio is 2/9

b. Using LRU page removal algorithm do a page trace analysis and compute the failure
and success ratio.

A B A C A B D(*) B A C(*) D(*)
failure/success ratio is 3/9 = 1/3

c. why is better? can you make a general statement for this example? why or why not?

It's better than in previous FIFO example, because 'memory use pattern' is more 'optimal' for us. Most time we use not more than 'frame size' number of pages. I.e. we use previously used pages more often, than in the first example.

Also FIFO is better than LRU in our case (2/9 vs 1/3).

d. Let us define most recently used MRU as a page removal algorithm that removes from memory the most recently used page. Do a page trace analysis using the same page request as before and compute the failures and success ratios

A B A C A B D(*) B(*) A C D(*)
failure/success ratio is 3/9 = 1/3

FIFO still better.

e. which of the three page removal algorithms is best and why u think so?

There is no 'best' algorithm. Algorithm quality depends on how application uses memory.
Say if application runs 'code' within these requested page frames, there is low probability that it will request previously 'seen' memory, in that case FIFO or MRU may be better (we should forget pages either sequentially or most recently accessed first). If application uses memory as a 'cache' for caching some content - LRU algorithm may be more effective. Usefulness of MRU is questionable and not efficient, because it doesn't get advantage of big 'frame size', it forgets everything that where just requested.