A page-replacement algorithm should minimize the number of pagefaults. We can achieve | StudySoup

Textbook Solutions for Operating System Concepts

Chapter 9 Problem 9.30

Question

A page-replacement algorithm should minimize the number of pagefaults. We can achieve this minimization by distributing heavily usedpages evenly over all of memory, rather than having them compete fora small number of page frames. We can associate with each page framea counter of the number of pages associated with that frame. Then,to replace a page, we can search for the page frame with the smallestcounter.a. Define a page-replacement algorithm using this basic idea. Specificallyaddress these problems:i. What is the initial value of the counters?ii. When are counters increased?iii. When are counters decreased?iv. How is the page to be replaced selected?b. How many page faults occur for your algorithm for the followingreference string with four page frames?1, 2, 3, 4, 5, 3, 4, 1, 6, 7, 8, 7, 8, 9, 7, 8, 9, 5, 4, 5, 4, 2.c. What is the minimum number of page faults for an optimal pagereplacementstrategy for the reference string in part b with fourpage frames?

Solution

Step 1 of 5)

The first step in solving 9 problem number 30 trying to solve the problem we have to refer to the textbook question: A page-replacement algorithm should minimize the number of pagefaults. We can achieve this minimization by distributing heavily usedpages evenly over all of memory, rather than having them compete fora small number of page frames. We can associate with each page framea counter of the number of pages associated with that frame. Then,to replace a page, we can search for the page frame with the smallestcounter.a. Define a page-replacement algorithm using this basic idea. Specificallyaddress these problems:i. What is the initial value of the counters?ii. When are counters increased?iii. When are counters decreased?iv. How is the page to be replaced selected?b. How many page faults occur for your algorithm for the followingreference string with four page frames?1, 2, 3, 4, 5, 3, 4, 1, 6, 7, 8, 7, 8, 9, 7, 8, 9, 5, 4, 5, 4, 2.c. What is the minimum number of page faults for an optimal pagereplacementstrategy for the reference string in part b with fourpage frames?
From the textbook chapter Virtual Memory you will find a few key concepts needed to solve this.

Step 2 of 7)

Visible to paid subscribers only

Step 3 of 7)

Visible to paid subscribers only

Subscribe to view the
full solution

Title Operating System Concepts  9 
Author Abraham Silberschatz, Peter B. Galvin, Greg Gagne
ISBN 9781118063330

A page-replacement algorithm should minimize the number of pagefaults. We can achieve

Chapter 9 textbook questions

×

Login

Organize all study tools for free

Or continue with
×

Register

Sign up for access to all content on our site!

Or continue with

Or login if you already have an account

×

Reset password

If you have an active account we’ll send you an e-mail for password recovery

Or login if you have your password back