Chapter 4 Device Management and Disk Scheduling DEVICE MANAGEMENT Content I/O device overview I/O device overview I/O organization and architecture I/O.

Slides:



Advertisements
Similar presentations
I/O Management and Disk Scheduling
Advertisements

I/O Management and Disk Scheduling
So far Binary numbers Logic gates Digital circuits process data using gates – Half and full adder Data storage – Electronic memory – Magnetic memory –
1 Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
I/O Management and Disk Scheduling
I/O Management and Disk Scheduling
Categories of I/O Devices
I/O Management and Disk Scheduling
Input and Output CS 215 Lecture #20.
CS-334: Computer Architecture
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
Input/Output Management and Disk Scheduling
1 Lecture 2: Review of Computer Organization Operating System Spring 2007.
Computer System Overview
1 Computer System Overview OS-1 Course AA
1 CSIT431 Introduction to Operating Systems Welcome to CSIT431 Introduction to Operating Systems In this course we learn about the design and structure.
Chapter 1 and 2 Computer System and Operating System Overview
I/O Management and Disk Scheduling (Chapter 10) Perhaps the messiest aspect of operating system design is input/output A wide variety of devices and many.
Device Management.
Computer System Overview Chapter 1. Basic computer structure CPU Memory memory bus I/O bus diskNet interface.
1 Today I/O Systems Storage. 2 I/O Devices Many different kinds of I/O devices Software that controls them: device drivers.
Group 7 Jhonathan Briceño Reginal Etienne Christian Kruger Felix Martinez Dane Minott Immer S Rivera Ander Sahonero.
Copyright ©: Nahrstedt, Angrave, Abdelzaher
Input/Output. Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower.
Chapter 7 Input/Output Luisa Botero Santiago Del Portillo Ivan Vega.
I/O Management and Disk Scheduling
Chapter 10: Input / Output Devices Dr Mohamed Menacer Taibah University
Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
Input/OUTPUT [I/O Module structure].
Computer Systems Overview. Page 2 W. Stallings: Operating Systems: Internals and Design, ©2001 Operating System Exploits the hardware resources of one.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
Computer System Overview Chapter 1. Operating System Exploits the hardware resources of one or more processors Provides a set of services to system users.
1 I/O Management and Disk Scheduling Chapter Categories of I/O Devices Human readable Used to communicate with the user Printers Video display terminals.
1 IO Management and Disk Scheduling Chapter Categories of I/O Devices n Human readable u used to communicate with the user u video display terminals.
1 I/O Management and Disk Scheduling Chapter
1 I/O Management and Disk Scheduling Chapter Categories of I/O Devices Human readable  Used to communicate with the user  Printers  Video display.
1 Lecture 20: I/O n I/O hardware n I/O structure n communication with controllers n device interrupts n device drivers n streams.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
Chapter 1 Computer System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
I/O Management and Disk Structure Introduction to Operating Systems: Module 14.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CE-321: Computer.
1 I/O Management and Disk Scheduling Chapter Categories of I/O Devices Human readable –Used to communicate with the user –Printers –Video display.
O VERVIEW OF M ASS S TORAGE S TRUCTURE Magnetic disks provide bulk of secondary storage of modern computers Drives rotate at 60 to 250 times per second.
CH10 Input/Output DDDData Transfer EEEExternal Devices IIII/O Modules PPPProgrammed I/O IIIInterrupt-Driven I/O DDDDirect Memory.
Fall 2000M.B. Ibáñez Lecture 25 I/O Systems. Fall 2000M.B. Ibáñez Categories of I/O Devices Human readable –used to communicate with the user –video display.
Page 1 2P13 Week 10. Page 2 Page 3 Static table-driven approaches performs a static analysis of feasible schedules of dispatching result is a schedule.
I/O Management and Disk Scheduling Chapter 11. Categories of I/O Devices Human readable Used to communicate with the user  Printers, Display terminals,
1 I/O Management and Disk Scheduling Chapter I/O Devices Can be group into three categories: 1.Human readable Used to communicate with the computer.
Lecture 1: Review of Computer Organization
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
IT3002 Computer Architecture
Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.
Input Output Techniques Programmed Interrupt driven Direct Memory Access (DMA)
بسم الله الرحمن الرحيم MEMORY AND I/O.
Fall 2000M.B. Ibáñez Lecture 26 I/O Systems II. Fall 2000M.B. Ibáñez Application I/O Interface I/O system calls encapsulate device behaviors in generic.
Chapter 101 I/O Management and Disk Scheduling Chapter 11.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
Chapter 11 I/O Management and Disk Scheduling Dave Bremer Otago Polytechnic, NZ ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Computer Systems Overview. Lecture 1/Page 2AE4B33OSS W. Stallings: Operating Systems: Internals and Design, ©2001 Operating System Exploits the hardware.
1 Computer System Overview Chapter 1. 2 Operating System Exploits the hardware resources of one or more processors Provides a set of services to system.
1 Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
I/O SYSTEMS MANAGEMENT Krishna Kumar Ahirwar ( )
Computer Architecture
Presentation transcript:

Chapter 4 Device Management and Disk Scheduling

DEVICE MANAGEMENT Content I/O device overview I/O device overview I/O organization and architecture I/O organization and architecture I/O buffering I/O buffering Disk scheduling Disk scheduling RAID RAID Notes: Difficult to develop a general, consistent solution. Just a generally discuss. Notes: Difficult to develop a general, consistent solution. Just a generally discuss.

DEVICE MANAGEMENT 4.1 I/O Devices (P452) Three categories: Human Readable Devices Human Readable Devices ٭Such as Keyboard, Mouse, Display, Printer and so on; Machine Readable Devices Machine Readable Devices ٭Such as Actuator, Controller, Sensor, Tape Drive, Disk Drive and so on; Communication Devices Communication Devices ٭Such as Modem, Network Adapter and so on.

DEVICE MANAGEMENT Classify There are many sorting standard. E.g. data rates There are many sorting standard. E.g. data rates

DEVICE MANAGEMENT Data Rates of Devices

DEVICE MANAGEMENT Differences in I/O Devices Application Application ٭Disk used to store files requires file-management software ٭Disk used to store virtual memory pages needs special hardware and software to support it ٭Terminal used by system administrator may have a higher priority than an ordinary user

DEVICE MANAGEMENT Differences in I/O Devices Complexity of control Complexity of control Unit of transfer Unit of transfer ٭Data may be transferred as a stream of bytes for a terminal or in larger blocks for a disk Data representation Data representation ٭Encoding schemes Error conditions Error conditions ٭Devices respond to errors differently

DEVICE MANAGEMENT 4.2 Techniques for Performing I/O (p ) 4.2 Techniques for Performing I/O (p ) Cyclic Test /Programmed Cyclic Test /Programmed Interrupt-Driven Interrupt-Driven DMA Control DMA Control

DEVICE MANAGEMENT Programmed I/O --P29. I/O module performs the action, not the processor I/O module performs the action, not the processor Sets appropriate bits in the I/O status register Sets appropriate bits in the I/O status register No interrupts occur No interrupts occur Processor checks status until operation is complete Processor checks status until operation is complete Busy-waits Busy-waits

DEVICE MANAGEMENT Interrupt-Driven I/O Processor is interrupted when I/O module ready to exchange data Processor is interrupted when I/O module ready to exchange data Processor is free to do other work Processor is free to do other work No needless waiting No needless waiting Consumes a lot of processor time because every word read or written passes through the processor Consumes a lot of processor time because every word read or written passes through the processor

DEVICE MANAGEMENT Direct Memory Access Transfers a block of data directly to or from memory Transfers a block of data directly to or from memory An interrupt is sent when the task is complete An interrupt is sent when the task is complete The processor is only involved at the beginning and end of the transfer The processor is only involved at the beginning and end of the transfer

DEVICE MANAGEMENT Evolution of the I/O Function Processor directly controls a peripheral device Processor directly controls a peripheral device Controller or I/O module is added Controller or I/O module is added ٭Processor uses programmed I/O without interrupts ٭Processor does not need to handle details of external devices

DEVICE MANAGEMENT Evolution of the I/O Function Controller or I/O module with interrupts Controller or I/O module with interrupts ٭Processor does not spend time waiting for an I/O operation to be performed Direct Memory Access Direct Memory Access ٭Blocks of data are moved into memory without involving the processor ٭Processor involved at beginning and end only

DEVICE MANAGEMENT Evolution of the I/O Function I/O channel I/O channel ٭I/O module is a separate processor. Its with a specialized instruction set tailored( ) for I/O. I/O processor I/O processor ٭I/O module has its own local memory ٭Its a computer in its own right

DEVICE MANAGEMENT Direct Memory Access Takes control of the system from the CPU to transfer data to and from memory over the system bus Takes control of the system from the CPU to transfer data to and from memory over the system bus Cycle stealing is used to transfer data on the system bus Cycle stealing is used to transfer data on the system bus The instruction cycle is suspended so data can be transferred The instruction cycle is suspended so data can be transferred The CPU pauses one bus cycle The CPU pauses one bus cycle No interrupts occur while cycle stealing No interrupts occur while cycle stealing ٭Do not save context

DEVICE MANAGEMENT Direct Memory Access

DEVICE MANAGEMENT DMA The Starting location in memory to read from or write to, communicated on the data lines and stored by the DMA module in its address register. The Starting location in memory to read from or write to, communicated on the data lines and stored by the DMA module in its address register. The number of words to be read or written, again communicated via the data lines and stored in the data count register. The number of words to be read or written, again communicated via the data lines and stored in the data count register.

DEVICE MANAGEMENT DMA and Interrupt Breakpoint The processor is suspended just before it needs to use the bus. The DMA unit then transfers one word and returns control to the processor. The processor is suspended just before it needs to use the bus. The DMA unit then transfers one word and returns control to the processor. Cycle stealing causes the CPU to execute more slowly. Cycle stealing causes the CPU to execute more slowly.

DEVICE MANAGEMENT DMA and Interrupt Breakpoint

DEVICE MANAGEMENT DMA Number of required bus cycles can be cut by integrating the DMA and I/O functions Number of required bus cycles can be cut by integrating the DMA and I/O functions Path between DMA module and I/O module that does not include the system bus Path between DMA module and I/O module that does not include the system bus

DEVICE MANAGEMENT DMA

DMA

DMA

4.3 Operating System Design Issues Efficiency Efficiency ٭Most I/O devices extremely slow compared to main memory ٭Use of multiprogramming allows for some processes to be waiting on I/O while another process executes ٭I/O cannot keep up with processor speed ٭Swapping is used to bring in additional ready processes which is an I/O operation ٭Thus, a major effort in I/O design has been schemes for improving the efficiency of I/O. e.g. disk I/O

DEVICE MANAGEMENT Operating System Design Issues Generality Generality ٭Desirable to handle all I/O devices in a uniform manner ٭Hide most of the details of device I/O in lower- level routines so that processes and upper levels see devices in general terms such as read, write, open, close, lock, unlock

Struct general_op{ int (*read)(…) int (*write)(…) };driver1: Struct general_op dev_op={ dev1_read, dev1_write dev1_write};driver2: Struct general_op dev_op={ dev2_read, dev2_write dev2_write};Gen_read(fd,…) {dev_op=map(fd); dev_op->read(…);}

DEVICE MANAGEMENT Logical Structure of the I/O Function (e.g. Hierarchical p458) Logical I/O Logical I/O ٭Is concerned with general I/O function, and is not concerned with the detail of actually controlling. E.g. read, write… Device I/O Device I/O ٭Implement I/O instructions, channel commands, and controller orders. May use buffering techniques.

DEVICE MANAGEMENT Logical Structure of the I/O Function Scheduling and Control Scheduling and Control ٭This is the level of software that actually interacts with the I/O module and the device hardware.

DEVICE MANAGEMENT

4.4 I/O Buffering(p460) 4.4 I/O Buffering(p460) Reasons for buffering Reasons for buffering ٭Processes must wait for I/O to complete before next proceeding. E.g: write to device (busy waiting or suspension on an interrupt) ٭Certain pages of the I/O request process must remain in main memory during I/O. ٭Single-process deadlock

DEVICE MANAGEMENT I/O Buffering Block-oriented Block-oriented ٭Information is stored in fixed sized blocks ٭Transfers are made a block at a time ٭Used for disks and tapes Stream-oriented Stream-oriented ٭Transfer information as a stream of bytes ٭Used for terminals, printers, communication ports, mouse, and most other devices that are not secondary storage

DEVICE MANAGEMENT Single Buffer Operating system assigns a buffer in the system portion of main memory for an I/O request Operating system assigns a buffer in the system portion of main memory for an I/O request Block-oriented Block-oriented ٭Input transfers made to buffer ٭Block moved to user space when needed ٭Another block is moved into the buffer Read aheadRead ahead

DEVICE MANAGEMENT

Single Buffer Block-oriented Block-oriented ٭User process can process one block of data while next block is read in ٭Swapping can occur since input is taking place in system memory, not user memory ٭Operating system keeps track of assignment of system buffers to user processes

DEVICE MANAGEMENT Single Buffer Stream-oriented Stream-oriented ٭Used a line at time. ٭User input from a terminal is one line at a time with carriage return signaling( ) the end of the line. ٭Output to the terminal is one line at a time.

DEVICE MANAGEMENT Single Buffer Performance comparison with no buffering Performance comparison with no buffering ٭T: the time to input a block ٭C: the time to computation ٭M: the time to move data ٭Max [C,T]+M and T+C

DEVICE MANAGEMENT Double Buffer Use two system buffers instead of one. Use two system buffers instead of one. A process can transfer data to or from one buffer while the operating system empties or fills the other buffer. A process can transfer data to or from one buffer while the operating system empties or fills the other buffer. Performance: max(C,T). Performance: max(C,T).

DEVICE MANAGEMENT Circular Buffer More than two buffers are used. More than two buffers are used. Each individual buffer is one unit in a circular buffer. Each individual buffer is one unit in a circular buffer. Used when I/O operation must keep up with process. Used when I/O operation must keep up with process.

DEVICE MANAGEMENT

Disk and Disk Scheduling(p463) The speed of processors and main memory has far outstripped that for disk access. The speed of processors and main memory has far outstripped that for disk access. The performance of disk storage subsystem is of vital concern. The performance of disk storage subsystem is of vital concern. How to improve the performance of disk? How to improve the performance of disk? ٭General methods ٭Special methods

DEVICE MANAGEMENT Disk Structure Headers Headers Cylinders Cylinders Tracks Tracks Sectors Sectors Capability=headers*cylinders*sectors*byte per sector Capability=headers*cylinders*sectors*byte per sector

DEVICE MANAGEMENT Disk Performance Parameters To read or write, the disk head must be positioned at the desired track and at the beginning of the desired sector To read or write, the disk head must be positioned at the desired track and at the beginning of the desired sector Seek time Seek time ٭movable-head system or fixed-head system ٭Time it takes to position the head at the desired track Rotational delay or rotational latency Rotational delay or rotational latency ٭Time its takes for the beginning of the sector to reach the head

DEVICE MANAGEMENT Disk Performance Parameters Data transfer time Data transfer time Wait for device or channel Wait for device or channel

DEVICE MANAGEMENT RPS (Rotational Positional Sensing) When seek command has been issued, the channel is released to handle other I/O operations. When seek command has been issued, the channel is released to handle other I/O operations. RPS miss. Must rotate again and reconnect again. RPS miss. Must rotate again and reconnect again.

DEVICE MANAGEMENT Seek Time Ts m×n s n=number of tracks traversed m=constant that depends on the disk drive s=startup time

DEVICE MANAGEMENT Rotational Delay Tr 1/(2r) r=rotation speed, in revolutions per second Example: r=3600rpm, Tr=1/120=8.3ms r=300rpm, Tr=1/10=100ms

DEVICE MANAGEMENT Transfer Time T b (r×N) b=number of bytes to be transferred N=number of bytes on a track r=rotation speed,in revolutions per second

DEVICE MANAGEMENT Total Average Access Time Ta=Ts+Tr+T

DEVICE MANAGEMENT A Timing Comparison Seek time: 20ms Seek time: 20ms Transfer rate: 1MB/s Transfer rate: 1MB/s r=3600rpm r=3600rpm 512byte per sector 512byte per sector 32 sector per track 32 sector per track Suppose to read 128k data Suppose to read 128k data

DEVICE MANAGEMENT A Timing Comparison 60*16k=960k<1MB/s 60*16k=960k<1MB/s Sequential organization Sequential organization ( ) ( )×7 220(ms) Randomly organization Randomly organization ( )× (ms)

DEVICE MANAGEMENT A Timing Comparison It is worthwhile to improve the I/O efficiency with purely random access to the disk It is worthwhile to improve the I/O efficiency with purely random access to the disk

DEVICE MANAGEMENT Disk Scheduling Policies Seek time is the reason for differences in performance. Seek time is the reason for differences in performance. For a single disk there will be a number of I/O requests. For a single disk there will be a number of I/O requests. If requests are selected randomly, we will get the worst possible performance. If requests are selected randomly, we will get the worst possible performance.

DEVICE MANAGEMENT Disk Scheduling Policies First-in, first-out (FIFO) First-in, first-out (FIFO) ٭Process request sequentially. ٭Fair to all processes. ٭Approaches random scheduling in performance if there are many processes.

DEVICE MANAGEMENT Disk Scheduling Policies Priority Priority ٭Goal is not to optimize disk use but to meet other objectives. ٭Short batch jobs may have higher priority. ٭Provide good interactive response time.

DEVICE MANAGEMENT FIFO (Starting at Track 100)

DEVICE MANAGEMENT Disk Scheduling Policies Last-in, first-out Last-in, first-out ٭The device is given to the most recent user so there should be little arm movement ٭Possibility of starvation since a job may never regain the head of the line

DEVICE MANAGEMENT Disk Scheduling Policies Shortest Service Time First Shortest Service Time First ٭Select the disk I/O request that requires the least movement of the disk arm from its current position ٭Always choose the minimum seek time

DEVICE MANAGEMENT SSTF

DEVICE MANAGEMENT Disk Scheduling Policies SCAN SCAN ٭Arm moves in one direction only, satisfying all outstanding requests until it reaches the last track in that direction ٭Direction is reversed ٭Max delay:2T. T: a scan time from inner track to outer track

DEVICE MANAGEMENT SCAN

DEVICE MANAGEMENT Disk Scheduling Policies C-SCAN C-SCAN ٭Restricts scanning to one direction only ٭When the last track has been visited in one direction, the arm is returned to the opposite end of the disk and the scan begins again ٭Max delay: T+Smax. Smax is the maximum seek time

DEVICE MANAGEMENT CSCAN

DEVICE MANAGEMENT Disk Scheduling Policies N-step-SCAN N-step-SCAN ٭Segments the disk request queue into subqueues of length N. ٭Subqueues are process one at a time, using SCAN. ٭New requests added to other queue when queue is processed. FSCAN FSCAN ٭Two queues ٭One queue is empty for new request

DEVICE MANAGEMENT

Figure 11.7 P469

DEVICE MANAGEMENT RAID(p471) Redundant Array of Inexpensive Disks Redundant Array of Inexpensive Disks Redundant Array of Independent Disks Redundant Array of Independent Disks

DEVICE MANAGEMENT RAID Using multiple disks can: Using multiple disks can: ٭I/O requests can be handled in parallel. ٭The reliability of disk can be improved.

DEVICE MANAGEMENT RAID Characteristics RAID is a set of physical disk drives viewed by the operating system as a single logical drive. (transparent) RAID is a set of physical disk drives viewed by the operating system as a single logical drive. (transparent) Data are distributed across the physical drives of an array.(distributed) Data are distributed across the physical drives of an array.(distributed) Redundant disk capacity is used to store parity information, which guarantees data recoverability in case of disk failure.(reliability) Redundant disk capacity is used to store parity information, which guarantees data recoverability in case of disk failure.(reliability)

DEVICE MANAGEMENT Strip Unit( ) Data are striped across the available disks. (fig 11.9)The strips are mapped round robin to consecutive array members. Data are striped across the available disks. (fig 11.9)The strips are mapped round robin to consecutive array members. Small strip: Small strip: ٭Parallel Access Technique Large strip: Large strip: ٭Independent Access Technique

DEVICE MANAGEMENT Verify Methods Mirror storage Mirror storage Hamming code(distance =n) Hamming code(distance =n) Parity verify (distance =2) Parity verify (distance =2) ٭X4(i) X3(i)+X2(i)+X1(i)+X0(i) ٭X1(i) X4(i)+X3(i)+X2(i)+X0(i) ٭Distribute or centralize storage

DEVICE MANAGEMENT RAID Characteristics Strip unit and storage method Strip unit and storage method Verify method and storage method Verify method and storage method

DEVICE MANAGEMENT RAID 0 (non-redundant)

DEVICE MANAGEMENT RAID 0

DEVICE MANAGEMENT RAID 0 non-redundant non-redundant non-verify non-verify distributed storage distributed storage Lower reliability Lower reliability Lower cost Lower cost Parallel I/O access Parallel I/O access

DEVICE MANAGEMENT RAID 1 (Mirrored) Distributed Distributed Mirrored/redundancy Mirrored/redundancy No verify No verify

DEVICE MANAGEMENT RAID 1 Read performance is better than RAID 0 (choose the seek time fewer disk to access) Read performance is better than RAID 0 (choose the seek time fewer disk to access) Write performance is worse than RAID 0 Write performance is worse than RAID 0 Higher cost Higher cost Recovery is simple Recovery is simple It can have higher parallel performance than RAID0 It can have higher parallel performance than RAID0

DEVICE MANAGEMENT RAID 2 (Redundancy Through Hamming Code)

DEVICE MANAGEMENT RAID 2 Strips are very small, as a single byte or word. Strips are very small, as a single byte or word. Hamming code in special disks Hamming code in special disks Lower cost than RAID1 but higher than RAID3, 4,5 Lower cost than RAID1 but higher than RAID3, 4,5

DEVICE MANAGEMENT RAID 3 (Bit-Interleaved Parity) Same as RAID2 but use parity verify,so it only need a single redundant disk Same as RAID2 but use parity verify,so it only need a single redundant disk

DEVICE MANAGEMENT RAID 3Performance Small strip bringParallel Access Technique but only one I/O request can be executed at a time. Small strip bring Parallel Access Technique but only one I/O request can be executed at a time. Lower cost than RAID2. Lower cost than RAID2.

DEVICE MANAGEMENT RAID 4 (Block-Level Parity)

DEVICE MANAGEMENT RAID 4 Large strip Large strip Parity verify and storage into a special disk Parity verify and storage into a special disk Parity disk become a bottleneck Parity disk become a bottleneck

DEVICE MANAGEMENT RAID 5 (Block-Level Distributed Parity)

DEVICE MANAGEMENT RAID 5 Same as RAID4 but parity information distributed Same as RAID4 but parity information distributed Avoid bottleneck found in RAID Level 4 Avoid bottleneck found in RAID Level 4

DEVICE MANAGEMENT Disk Cache(p479) Buffer in main memory for disk sectors. Buffer in main memory for disk sectors. Contains a copy of some of the sectors on the disk. Contains a copy of some of the sectors on the disk. According to locality principle to cache. According to locality principle to cache.

DEVICE MANAGEMENT Using Methods From disk-cache copy to user process space. From disk-cache copy to user process space. Using a shared memory capability and passing a pointer to the appropriate slot in the disk cache. Using a shared memory capability and passing a pointer to the appropriate slot in the disk cache.

DEVICE MANAGEMENT Least Recently Used (I) The block that has been in the cache the longest with no reference to it is replaced. The block that has been in the cache the longest with no reference to it is replaced. The cache consists of a stack of blocks. The cache consists of a stack of blocks. Most recently referenced block is on the top of the stack. Most recently referenced block is on the top of the stack. When a block is referenced or brought into the cache, it is placed on the top of the stack. When a block is referenced or brought into the cache, it is placed on the top of the stack.

DEVICE MANAGEMENT Least Recently Used (I) The block on the bottom of the stack is removed when a new block is brought in. The block on the bottom of the stack is removed when a new block is brought in. Blocks dont actually move around in main memory. Blocks dont actually move around in main memory. A stack of pointers is used. A stack of pointers is used.

DEVICE MANAGEMENT Least Frequently Used (II) The block that has experienced the fewest references is replaced. The block that has experienced the fewest references is replaced. A counter is associated with each block. A counter is associated with each block. Counter is incremented each time block accessed. Counter is incremented each time block accessed. Block with smallest count is selected for replacement. Block with smallest count is selected for replacement. Some blocks may be referenced many times in a short period of time and then not needed any more. Some blocks may be referenced many times in a short period of time and then not needed any more.

DEVICE MANAGEMENT Integrate Methods(1)

DEVICE MANAGEMENT Integrate Methods(1) A area in new section, the count not add. A area in new section, the count not add. A area whose count is the least in old section will be replaced. A area whose count is the least in old section will be replaced. The count remains at 1 as long as the block remains in the new section The count remains at 1 as long as the block remains in the new section

DEVICE MANAGEMENT Integrate Methods(2)

DEVICE MANAGEMENT Integrate Methods(2) The count in middle section can add, but not replace the area in this section The count in middle section can add, but not replace the area in this section

DEVICE MANAGEMENT Appendix 11a p492 Disk storage devices Disk storage devices