This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: CS 414 Assignment 6 5 points per answer for 1a-f, 6a-b, 10 points per answer for 3, 4, 6c-d, 15 points for 2, 5 (110 max). Due Wednesday April 26. 1. Suppose that a disk drive has 5000 cylinders, numbreed 0 to 4999. The drive is currently serving a request at cylinder 143, and the previous request was at cylinder 125. The queue of pending requests, in FIFO order, is 130 , 1750 , 1022 , 1509 , 948 , 1774 , 913 , 1470 , 86 Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to satisfy all the pending requests for each of the following disk-scheduling algorithms? (a) FCFS Solution 7037 - there were a lot of students who made small math errors. (b) SSTF Solution 1745 (c) SCAN Solution 9769 (d) LOOK Solution 3319 (e) C-SCAN Solution 9985 - many students didnt go all the way back to 0. (f) C-LOOK Solution 3363 - many students didnt go all the way back to 86 before servicing requests again. 2. Some file systems allow disk storage to be allocated at different levels of granularity. For instance, a file system could allocate 4 KB of disk space as a singe 4-KB block or as eight 512-byte blocks. What kind of applications might exploit this feature to request a larger block size? What kind of applications would probably want a smaller file size? What modifications would have to be made to the free-space management scheme in order to support this feature? Solution It make sense to use large block size for applications that perform sequential access on large files (video applications, databases). They have to perform lot fewer block reads and hence suffer fewer interrupts. Applications that generate lot of small files (browsers) might use smaller block size since the files fit in one block most of the time and the file access is faster with smaller block size; this also reduces wastage due to internal fragmentation. Applications like databases that perform edit operations on fixed length records stored in the files might prefer smaller block size since the write operations are more efficient. The free-space manager might have to maintain separate free-lists for each block size (assuming blocks of size 512 bytes and 4KB, it has to maintain one list for 512 byte blocks and another for 4 KB blocks). It is more efficient to maintain a single free list of 512 byte blocks with the first block among a sequence of contiguous blocks recording the number of free blocks in the continguous sequence. 512 byte blocks if not available can be obtained by breaking a 4 KB block, 4 KB blocks can be made up of 8 contiguous 512 byte blocks. Ensuring that the 4 KB blocks are aligned (start at addresses divisible by 2 12 ) makes the address translation efficient....
View Full Document
- Spring '06