a6sp06solutions

# a6sp06solutions - CS 414 Assignment 6 5 points per answer...

• Homework Help
• 501844684_ch
• 3

This preview shows pages 1–2. Sign up to view the full content.

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 didn’t go all the way back to 0. (f) C-LOOK Solution 3363 - many students didn’t 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.

This preview has intentionally blurred sections. Sign up to view the full version.

This is the end of the preview. Sign up to access the rest of the document.
• Spring '06
• BIRMAN
• Computer file, original file contents

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern