当前位置:网站首页>CPT 104_TTL 09
CPT 104_TTL 09
2022-04-23 05:20:00 【NONE_WHY】
Useful Infomation

A page fault occurs when the referenced page is not found in the main memory
Page fault handling routine is executed on the occurrence of page fault
The time taken to service the page fault is called as page fault service time.
1. Tutorial 01
1.1. Exercise 1
1.1.1. Question
- In a demand-paging system, it takes 250 ns to satisfy a memory access when the requested page is in the resident set.
- If it is not in the resident set, then the request takes 10 ms if a free frame is found or the page to be replaced is not modified. Such requests are 3% of all the accesses.
- Otherwise, if there is no free frame and the page to be replaced is modified, then it takes 20 ms. Such pages are 7% of all the accesses.
- If the Page Fault Rate PFR in the system is 10%, then what will be the EAT?
1.1.2. Analysis
- Page Fault Rate = Page Fault with Free Frame Rate + Page Fault without Free Frame Rate
- Page Fault Time = Page Fault with Free Frame Time + Page Fault without Free Frame Time
- Page Fault with Free Frame Time = Page Fault with Free Frame Rate x 10 ms
- Page Fault without Free Frame Time = Page Fault without Free Frame Rate x 20 ms
1.1.3. Solution
1.2. Exercise 2
1.2.1. Question
- Calculate the number of page faults for the following reference string using FIFO algorithm with frame size as 3 and then as 4
- 4 3 2 1 4 3 5 4 3 2 1 5
- FIFO - the oldest page is chosen
1.2.2. Solution
-
Frame size = 3 4 3 2 1 4 3 5 4 3 2 1 5 4 4 4 1 1 1 5 5 5 3 3 3 4 4 4 2 2 2 2 2 3 3 3 1 Number:9 -
Frame size = 4 4 3 2 1 4 3 5 4 3 2 1 5 4 4 4 4 5 5 5 5 1 1 3 3 3 3 4 4 4 4 5 2 2 2 2 3 3 3 3 1 1 1 1 2 2 2 Number:10
1.3. Exercise 3
1.3.1. Question
- Calculate the number of page faults for the following reference string using optimum algorithm with frame size as 3
- 5 0 2 1 0 3 0 2 4 3 0 3 2 1 3 0 1 5
- OA – replace a page that will not be used for longest period of time
1.3.2. Solution
-
optimum algorithm with frame size as 3 5 0 2 1 0 3 0 2 4 3 0 3 2 1 3 0 1 5 5 5 5 1 3 3 3 3 5 0 0 0 0 0 0 0 0 2 2 2 4 2 1 1 Number:9
1.4. Exercise 4
1.4.1. Question
- Calculate the number of page faults for the following reference string using LRU page-replacement algorithm with frame size as 3.
- 5 0 2 1 0 3 0 2 4 3 0 3 2 1 3 0 1 5
- throw out the page that has been unused for the longest time
1.4.2. Solution
-
optimum algorithm with frame size as 3 5 0 2 1 0 3 0 2 4 3 0 3 2 1 3 0 1 5 5 5 5 1 1 2 2 2 0 0 1 1 1 0 0 0 0 0 0 3 3 3 3 3 5 2 2 3 3 4 4 4 2 2 0 0 Number:13
2. PAGE FAULT
2.1. Exercise 2
2.1.1. Question
- Let the page fault service time be 10 ms in a computer with average memory access time being 20 ns. If one page fault is generated for every
memory accesses, what is the effective access time for the memory?
- a. 21 ns
- b. 30 ns
- c. 23 ns
- d. 35 ns
2.1.2. Solution
- Option (B) is correct
3. PAGE REPLACEMENT ALGORITHMS
3.1. Problem-01
3.1.1. Question
- A system uses 3-page frames for storing process pages in main memory. It uses the First in First out (FIFO) page replacement policy. Assume that all the page frames are initially empty. What is the total number of page faults that will occur while processing the page reference string given below?
- 4 , 7, 6, 1, 7, 6, 1, 2, 7, 2
- Also calculate the hit ratio and miss ratio
3.1.2. Solution
-
FIFO algorithm with frame size as 3 4 7 6 1 7 6 1 2 7 2 4 4 4 1 1 1 7 7 7 2 2 6 6 6 7 - Total number of references = 10
- Total number of page misses or page faults = 6
- Total number of page hits = 4
- Hit ratio = Total number of page hits / Total number of references = 4 / 10 = 40%
- Miss ratio = 1 - Hit ratio = 1 - 40% = 60%
3.2. Problem-02
3.2.1. Question
- A system uses 3-page frames for storing process pages in main memory. It uses the Least Recently Used (LRU) page replacement policy. Assume that all the page frames are initially empty. What is the total number of page faults that will occur while processing the page reference string given below?
- 4 , 7, 6, 1, 7, 6, 1, 2, 7, 2
- Also calculate the hit ratio and miss ratio
3.2.2. Solution
-
LRU algorithm with frame size as 3 4 7 6 1 7 6 1 2 7 2 4 4 4 1 1 1 7 7 7 2 2 6 6 6 7 - Total number of references = 10
- Total number of page misses or page faults = 6
- Total number of page hits = 4
- Hit ratio = Total number of page hits / Total number of references = 4 / 10 = 40%
- Miss ratio = 1 - Hit ratio = 1 - 40% = 60%
3.3. Problem-03
3.2.1. Question
- A system uses 3-page frames for storing process pages in main memory. It uses the Optimal page replacement policy. Assume that all the page frames are initially empty. What is the total number of page faults that will occur while processing the page reference string given below?
- 4 , 7, 6, 1, 7, 6, 1, 2, 7, 2
- Also calculate the hit ratio and miss ratio
3.2.2. Solution
-
LRU algorithm with frame size as 3 4 7 6 1 7 6 1 2 7 2 4 4 4 1 1 7 7 7 7 6 6 2 - Total number of references = 10
- Total number of page misses or page faults = 5
- Total number of page hits = 5
- Hit ratio = Total number of page hits / Total number of references = 5 / 10 = 50%
- Miss ratio = 1 - Hit ratio = 1 - 50% = 50%
版权声明
本文为[NONE_WHY]所创,转载请带上原文链接,感谢
https://blog.csdn.net/Astronaut_WHY/article/details/124352783
边栏推荐
- 学习笔记:Unity CustomSRP-11-Post Processing---Bloom
- configmap
- Interesting prime number problem hdu5750
- Study notes: unity customsrp-11-post processing --- bloom
- 云计算与云原生 — OpenShift 的架构设计
- Publish your own wheel - pypi packaging upload practice
- 2022年最热门的招聘技术技能是什么,您绝对想不到
- Laravel [view]
- 低代码和无代码的注意事项
- 《2021年IT行业项目管理调查报告》重磅发布!
猜你喜欢

What are the reasons for the failure of digital transformation?

DevOps生命周期,你想知道的全都在这里了!

JSP -- Introduction to JSP

Blender programmed terrain production

The 2021 IT industry project management survey report was released!

MySQL foreign key constraint

Solution of how to log in with mobile phone verification code in wireless network

Let the LAN group use the remote device

Modèle axé sur le domaine DDD (III) - gestion des transactions à l'aide de Saga

Backup MySQL database with Navicat
随机推荐
The annual transaction volume of the app store is US $1 million, and only 15% commission is paid. Small and medium-sized developers are very contradictory
node中的redis使用--ioredis
Source code analysis of how to use jump table in redis
WTL self drawn control library (cqscheckcomboxbox)
改进DevSecOps框架的 5 大关键技术
Project manager's thinking mode worth trying: project success equation
Semi synchronous replication of MariaDB
Anti crawler (0): are you still climbing naked with selenium? You're being watched! Crack webdriver anti crawler
Chapter II project scope management of information system project manager summary
configmap
Good test data management, in the end how to do?
Graphics.FromImage报错“Graphics object cannot be created from an image that has an indexed pixel ...”
数据安全问题已成隐患,看vivo如何让“用户数据”重新披甲
Interview summary
狼叔来找翻译人员了--plato--持续翻译中.....
Interpretation of common SQL statements
学习笔记:Unity CustomSRP-12-HDR
JSP -- Introduction to JSP
即将毕业的大学生找技术开发工作的焦虑根源
2021-09-27

memory accesses, what is the effective access time for the memory?


