Presentation is loading. Please wait.

Presentation is loading. Please wait.

B.Ramamurthy1 IO Management and Disk Scheduling B. Ramamurthy.

Similar presentations


Presentation on theme: "B.Ramamurthy1 IO Management and Disk Scheduling B. Ramamurthy."— Presentation transcript:

1 B.Ramamurthy1 IO Management and Disk Scheduling B. Ramamurthy

2 2 Introduction In addition to primary memory (volatile), computer systems provide users secondary storage units which may be used for persistent (or permanent) storage. A file is a collection of data elements grouped together for the purposes of access control, retrieval and modification. A file system together with IO management subsystem accomplish the mapping of abstract user interface into the actual collection of hardware such as disk, tape etc. of varying characteristics. Recently there has been lot of interest in a storage medium called RAID. We will look into this (11.6) We will study IO management in this discussion (Ch.11) and File system in the next chapter (Ch. 12)

3 B.Ramamurthy3 Topics for discussion IO devices Device Characteristics IO Design Objectives A model of IO Organization Buffering Disk IO Disk scheduling Disk cache RAID storage Summary

4 B.Ramamurthy4 IO Devices IO devices can be grouped into three categories: Human readable: Suitable for use with computer user. Example: video display terminals, keyboard, mouse and printers. Machines readable: Example: disks, tapes, sensors, controllers. Communication: Suitable for communicating with remote devices: Drivers, modems, sockets, etc.

5 B.Ramamurthy5 Device Characteristics Devices vary widely in characteristics such as: Data rate, applications, complexity of control, unit of transfer, data representation, Error conditions. Programmed IO, Interrupt-driven IO and Direct-memory access are three techniques for performing IO.

6 B.Ramamurthy6 IO Design Objectives Efficiency : IO operations often form the bottleneck in a computing system. Generality: Handle all devices in a uniform manner. How? Use hierarchical, modular approach to design of IO subsystem. This approach hides most of the details of device details in lower-levels so that processes and upper levels of OS see devices in terms of general functions such as Read, Write, Open, Lock, UnLock etc.

7 B.Ramamurthy7 A Model of IO Organization User Processes Logical IO Comm. Arch. Dir. Mgt. Physical Org. File System Device IO Sched. & Control Hardware Device IO Sched & Control Hardware Device IO Sched & Control Hardware Local Peripheral DeviceComm Port File System

8 B.Ramamurthy8 Buffering In order to avoid inefficiencies associated with direct transfer from user-process to IO device, buffering schemes can be used. Buffering smoothes out the peaks in IO demand. Buffering depends on the type of IO device: Block-oriented (Ex: disks) and Stream-oriented (terminal, comm. ports). Stream-oriented IO: single buffering; Block-oriented Devices: double buffer, circular buffer

9 B.Ramamurthy9 Disk IO A disk contains a stack of recording surfaces each surface with a movable read/write head. Each surface has circular tracks and each track divided into sectors. A stack of tracks make up a cylinder. To read or write, the head must be positioned at the desired track and at the beginning of the desired sector.

10 B.Ramamurthy10 Disk IO Seek Time (Ts) is the time it takes to position the head at the desired track. Rotational Delay (Tr) is the time it takes to to line up the head at the beginning of the desired sector. Access Time (Ta ) = Ts + Tr The data transfer time (Tt) is the time to read/write data at the desired position.

11 B.Ramamurthy11 Disk Scheduling Among the times Seek time is the most critical. Average access time can be improved by reducing the average Seek Time. Assumption: A queue of requests for each IO device is maintained. At any time a number of requests from various processes are in the queue. Consider a sequence of n-requests for scheduling. Example: Tracks: 55, 58, 39, 18, 90, 160, 150, 38 Using FIFO, SSTF, SCAN, C-SCAN. Table 11.3, Fig.11.7

12 B.Ramamurthy12 Disk Cache A disk cache is a buffer in main memory for disk sectors. Cache contains a copy of the some of the sectors on the disk. When a IO request is made for a particular sector, if the data is available on disk cache it is taken. Otherwise it can be brought into the cache from the disk. Similar to virtual memory principles. Directory blocks are good candidates for caching.

13 B.Ramamurthy13 Redundant Array of Independent Disks (RAID) zIs a set of disk drives viewed by operating system as a single logical device. zData are distributed across the physical drives of an array. zRedundant disk capacity is used to store parity information, which guarantees data recoverability in case of disk failure. zRaid levels 0 to 7

14 B.Ramamurthy14 RAID Levels zRAID 0 - striping zRAID 1 - Mirrored zRAID 2 - Error correcting using Hamming code zRAID 3 - bit-interleaved parity zRAID 4 - Block-interleaved parity (independent access) zRAID 5 - Block-interleaved parity (independent access) zRAID 6 - P + Q redundancy zRAID 7 - heterogeneous devices

15 B.Ramamurthy15 RAID (contd.) zUnique contribution of the RAID is to address the need for redundancy. zPrinciple : redundancy + compensate for reduced reliability zEven though use of multiple heads and actuators result in higher transfer rates, they also introduce higher probability of failure. zTo compensate for this decreased reliability, RAID makes use of stored parity information to recover data lost due to disk failure.

16 B.Ramamurthy16 RAID 1 zRAID 0 : data is striped across many disks similar to interleaved memory. yNot actually RAID. yNo redundancy but high transfer rate due to organization. zRAID 1 : redundancy is achieved by simple duplicating. yRead can be performed by either disk which ever has lower seek and rotational time. yWrite can be performed simultaneous on the two disks. yRecovery from failures is simple: use the surviving disk.

17 B.Ramamurthy17 RAID 2 zRAID 2 - RAID 5 have some kind of parity. zRAID 2 : ystriping yHamming error correcting code y4 data disks, 3 Hamming code disks yEffective in environment which are error prone.

18 B.Ramamurthy18 RAID 3 zSimilar to RAID but only one single redundant disk. zSingle redundant disk contains the parity info of the bits across the four disks. zSingle disk failure can be tolerated with slightly lower transfer rate until the failed disk is replaced.

19 B.Ramamurthy19 RAID 4 and 5 zIndependently accessible. zStrip parity (text calls it block parity). zLarge strips. zIn RAID 4 parity is stored on a single disk, and in RAID 5 parity is distributed over disks.

20 B.Ramamurthy20 RAID 6 and RAID 7 zRAID 6 : real fault tolerance hardware included. Significantly more expensive than RAID 5. zRAID 7 : using distributed and heterogenous sources of data.

21 B.Ramamurthy21 Summary Look at exercises 11.1, 11.2, 11.7, 11.8 Hardware characteristics underlying IO devices are abstracted for presenting easier-to-use and uniform logical interface to the processes. Performance improvement is another important objective which is achieved through buffering schemes and scheduling algorithms.


Download ppt "B.Ramamurthy1 IO Management and Disk Scheduling B. Ramamurthy."

Similar presentations


Ads by Google