Assignment 8, due Apr 4
Part of
the homework for 22C:112, Spring 2008
|
Always, on every assignment, please write your name legibly as it appears on your University ID and on the class list! All assignments will be due at the start of class on the day indicated (usually a Friday). The only exceptions to this rule will be by advance arrangement unless there is what insurance companies call "an act of God" - something outside your control. Homework must be turned in on paper and in class! Late work may be turned in to the teaching assistant's mailbox, but see the late work policy. Never push late work under someone's door!
Consider this sequence of operations on a pre-existing disk file:
fd = open( ... ); lseek( fd, pos, SEEK_SET ) write( fd, buf, 512 ) close( fd );
a) Describe the values of pos and buf that lead to the best case with regard to disk input/output performance. (0.5 points)
b) Assume that pos does not conform to the constraints outlined in your answer to part a above, how many distinct read and write operations must be performed by the disk hardware? Explain them! (0.5 points)
c) Assume that buf does not conform to the constraints outlined in your answer to part a above, how many distinct copys must be made from the user's buffer. Explain them. (0.5 points)
d) Combine your answers to parts b and c, describing a likely sequence of events. You may assume the system has some kind of disk cache, if that simplifies your answer. (0.5 points)
Background Look at the boundary tag data structure documented in the notes for Lecture 27. Assume you eliminate the use of a free list, and simply search sequentially through the heap for the next block. Also assume that you always start searching from the lowest block in the heap.
a) How does the data structure simplify in this case. (Hint, the simplification is considerable). (0.5 points)
b) If your computer system has virtual memory, what would the performance implications of this new heap be, as compared with the heap described in the notes. (There are implications with regard to page fault rate that are distinct from the implications with regard to CPU cycles needed per allocate, on average.) (0.5 points)