HOMEWORK 4 SOLUTION ------------------- Dec. 14, 1998 Problem 1 --------- a) FIFO: 100, 27, 129, 110, 186, 147, 41, 10, 64, 120 Ave. Seek = 556/9 = 61.8 SSTF: 100, 110, 120, 129, 147, 186, 64, 41, 27, 10 Ave. Seek = 262/9 = 29.1 LOOK: 100, 64, 41, 27, 10, 110, 120, 129, 147, 186 Ave. Seek = 266/9 = 29.6 LOOK is bidirectional. C-LOOK: 100, 64, 41, 27, 10, 186, 147, 129, 120, 110 Ave. Seek = 338/9 = 37.6 C-LOOK is bidirectional. This solution assumes that the direction is in decreasing cylinder numbers. b) o 100 o 64 o 41 o 27 o 10 o 186 o 147 o 129 o 120 o 110 Problem 2 --------- a) The fact that there are 9 tracks means that the bits are layed out in the following manner: byte 0 | byte 1 | | v v ... - - - - - - - - - - - - - - - - - - - - - - - Track 0 - - - - - - - - - - - - - - - - - - - - - - - Track 1 - - - - - - - - - - - - - - - - - - - - - - - Track 2 - - - - - - - - - - - - - - - - - - - - - - - Track 3 - - - - - - - - - - - - - - - - - - - - - - - Track 4 - - - - - - - - - - - - - - - - - - - - - - - Track 5 - - - - - - - - - - - - - - - - - - - - - - - Track 6 - - - - - - - - - - - - - - - - - - - - - - - Track 7 - - - - - - - - - - - - - - - - - - - - - - - Track 8 Track 8 contains the parity bits. The other tracks contain data bits. So, R = DS bytes/sec b) R = 1,600 x 1,200 = 192,000 bytes/sec c) If x is the distance the tape moves, then the first derivative dx/dt is the tape speed. Let t be the time to move G/2 inches; i.e., half the gap. GAP A plot of speed versus time is: dx/dt | - - - - - - - - - | / \ | / slope = C \ |/ \ -----|---------------|--------> time t GAP Then, dx/dt = C t, 0 <= t <= t (1) GAP Integrating, 2 x = C t / 2 (2) Equ. (2) for x = G/2 can be used to solve for t : GAP 2 G/2 = C t / 2 ==> t = SQRT (G/C) (3) GAP GAP Use Equ. (1) for x = G/2 to solve for the constant C: S = C t (4) GAP Combine (3) and (4): t = G / S (5) GAP The time to read 1 record (assuming start/stop) is: t (1) = 2 t + L / (DS) = 2 G / S + L / (DS) (6) READ GAP The value of G was not given. But for G = 1 inch, t (1) = 2 / 120 + 1200 / (1600 x 120) = 23 ms READ d) Let N be the tape capacity. Then, N = (2,400 ft x 12 in/ft) / (1200 bytes / 1600 bytes/inch) = 16,457 records If the tape stops between records, t = N t (1) READ READ = 16,457 x 23 ms = 378.5 sec = 6.3 min If the tape does not stop between records, t = 2400 ft x 12 in/ft / (S = 120 in/sec) = 240 sec = 4 min READ Problem 3 --------- The problem statement didn't clearly describe the block boundary. The solution below assumes that a block is an integral number of sectors. Thus, logical records span sectors, but not blocks. The answer for the case when logical records span blocks is given in brackets. a) 512 byte sectors, 96 sectors/track, 110 tracks/surface, 8 surfaces Capacity = 512 x 96 x 110 x 8 bytes = 43,253,760 bytes b) 1 block = 10 records = 1200 bytes (i.e., 3 sectors) 1 track = 32 blocks = 96 x 512 bytes = 49,152 bytes Records/track = 32 blocks x 10 records/block = 320 records/track Number of tracks = 110 x 8 = 880 Number of records = 320 x 880 = 281,600 [ Alternate Solution: 40 physical records/track, 35,200 records/disk ] c) Fragmentation/track = 32 blocks x (3 x 512 -1200) = 32 x 336 = 10,752 bytes/track Total fragmentation = 10,752 x 110 x 8 bytes = 9,461,760 bytes Percent fragmentation = 100% x 9,461,760 / 49,152 = 20% [ Alternate Solution: 2.3% ] d) Assume block buffering: Number blocks = 32 blocks/track x 880 tracks = 28,160 blocks 3600 RPM ==> rotation time = 16.67 ms T = #blocks x (t + t + 0.5 t + t ) QUEUE SEEK ROTATE TRANSFER where t = (blocking factor) t / (#blocks/track) TRANSFER ROTATE T = 473 sec = 7.9 min [ Alternate Solution: 110 x 8 x 33 ms = 29.3 sec, the time to read each track. ] e) Since the system is dedicated, there is no queueing. But every read requires a full rotation because the 200 us means that the desired block will have moved passed the read/write head. T = 28,160 (16.67 ms + 0.5 ms) = 483 sec. = 8.1 min Problem 4 --------- a) Suppose that there are m disk drives and n strips per drive. The space-time diagram for m = 4 and n = 1 might look like: 0 DDDDDDD-SSSSSSSSSSS-RRRRRR-TTTTTTT 1 DDDDDDD-SSSSSSSSSSS-RRRRRR-TTTTTTT 2 DDDDDDD-SSSSSSSSSSS-RRRRRR-TTTTTTT 3 DDDDDDD-SSSSSSSSSSS-RRRRRR-TTTTTTT D: Delta delay, S: Seek, R: Rotate, T: Transfer The point is that the transfer time component can not be overlapped with each other. b) Then, if we assume a synchronization after each round: T(m,n) = n t + n t + (2n + nm - 1) DELTA SEEK LATENCY T(m,n) = (nm - 1) DELTA + n (DELTA + t + t + DELTA) [1] SEEK LATENCY The maximum concurrency occurs when the seek and latency time components completely overlap the transfer time component. In that case, T(m,n) = t + t + (nm + 1) DELTA [2] SEEK LATENCY c) The effective transfer rate for m drives is: ETR (m,n) = m n B / T(m,n) [3] where B is the blocksize. The speed-up is: S = m n T(1,1) / T(m,n) [4] Using [1] in [4] yields, mn (DELTA + t + t + DELTA) SEEK LATENCY S = ---------------------------------------------------- (nm - 1) DELTA + n (DELTA + t + t + DELTA) SEEK LATENCY For large seek and latency times compared to DELTA, S = m [6] If we use [2] in [4], mn (DELTA + t + t + DELTA) SEEK LATENCY S = ------------------------------------- t + t + (nm + 1) DELTA SEEK LATENCY For large enough n and m and large seek and latency times, S = (t + t ) / DELTA [7] SEEK LATENCY d) There must be some mapping of requests to blocks that allows the maximum concurrent access. Striping is a simple technique because the same block request parameters can be sent concurrently to all drives. There are other techniques that can attain the same access speed, but setup and block allocation is simplified through striping.