🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

chapter11.pdf

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Transcript

[Type here] DISK I/O Disk is the most commonly used I/O device. It is the basic storage device that O.S., application software and data are kept. The details of disk I/O operation depends on the computer system, the O.S., nature of the I/O channel and disk controller hardware. Read / Write Head A g...

[Type here] DISK I/O Disk is the most commonly used I/O device. It is the basic storage device that O.S., application software and data are kept. The details of disk I/O operation depends on the computer system, the O.S., nature of the I/O channel and disk controller hardware. Read / Write Head A general timing diagram of disk I/O transfer is shown below. Wait For Device Wait For Channel Seek Rotational Delay Data Transfer I--------------------I----------------------I--------I----------------------I-------------------I Device is Busy Access Time Disk Performance Parameters When the disk drive is operating, the disk is rotating at constant speed to read or write. The head must be positioned at the desired track and at the beginning of the desired sector on that track. Track selection involves moving the head in a movable-head system or electronically selecting one head on a fixed head system. On a movable-head system, the time it takes to position the head at the track is known as seek time. In ether case, once the track is selected, the disk controller waits until the appropriate sector to line up with the head. The time it takes for the beginning of the sector to reach the head is known as rotational delay, or rotational latency. The sum of seek time if any and the rotational delay is the access time, the time takes to get into position to read or write. Once head is in position, the read or write operation is then performed as the sector moves under the head; this is the data transfer portion of the operation. In addition to the access time and transfer time, several queuing delays are normally associated with a disk I/O operation. When a process issues an I/O request, it must first wait in a queue for the device to be available. If the device shares a single I/O channel or a set of I/O channels with other disk drives, then there may be an additional wait for the channel to be available. Seek Time -1- [Type here] Seek time is the time requires to move the disk arm to the required track. This is a difficult quantity to pin down. The seek time consist of two key components: Initial start up time and the time taken to traverse the cyclinders that have to be crossed once the access arm is up to speed. We can approximate seek time with the linear formula: TS = m . n . s Where TS = Estimated seek time n = number of tracks traversed m = constant that depends on disk drive s = start up time Rotational Delay Disks other than floppy disks rotate at 3600rpm, which is one revolution per 16,7ms. Thus on the average the rotational delay will be 8,3ms. Floppy disks rotate much more slowly, typically between 300rpm and 600rpm, thus the average delay will be between 100ms and 200ms. Transfer Time The transfer time to or from the disk depends on the rotation speed of the disk in the following fashion: T= b / (r.N) Where T = Transfer Time b = Number of bytes to be tranferred N = Number of bytes on the track r = Rotation speed in revolution per second Thus the total average access time can be expressed as: Ta = Ts + (1/2r) + [b / (r.N)] Example: Let us look at two diffferent organisation of data on disk: sequential and random. Supposing we are using a disk drive with average seek time 20ms, 512 byte/sector, and 32 sectors/track. Sequential Organisation: If a file 128KB long (256 sectors) stored on disk which occupies 8 adjacent tracks (8 x 32 sector / track = 256 sector) then the time to read the first track is as follows: Average seek = 20 ms Rotational delay = 8,3 ms Read 32 sectors = 16,7 ms (one revolution) -------------------------------------= 45 ms First track will take 45 ms to be read. The remaining 7 tracks will require no seek time because of the adjacent organisation of the next portion of the program (7 tracks). Therefore each successive track is read in 8,3 + 16,7 = 25 ms. -2- [Type here] To read the entire file: Total Time = 45 + (7 x 25) = 220ms Random Organisation If the same file of 128 KB is stored on different locations on the disk where all 8 tracks are in different places then the seek time has to be considered as effective for each sector. For each sector: Average seek = 20 ms Rotational Delay = 8,3 ms Read 1 sector = 0,5 ms --------------------------------------28,8 ms Total Time = 256 x 28,8 = 7373 ms Above examples show the effect of fragmented files on disk. More fragmentation well lead to slower access to scatered sectors keeping the different portions of files. To avoid fragmentation many disk utility programs offer disk defragmenting facilities. -3-

Tags

computer science data storage disk I/O
Use Quizgecko on...
Browser
Browser