Presentation on theme: "B.Ramamurthy1 IO Management and Disk Scheduling B. Ramamurthy."— Presentation transcript:
B.Ramamurthy1 IO Management and Disk Scheduling B. Ramamurthy
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)
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
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.
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.
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.
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
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
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.
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.
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
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.
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
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.
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.
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.
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.
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.
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.
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.