### Comp111 Final Exam Dec 16, 2013 - open books and notes

Any and all printed and written materials are allowed, including books, course notes, and handwritten notes.

No electronic devices of any kind are allowed, including cellphones, calculators, pagers, laptops, etc. Please turn these off before beginning the exam.

Please do not discuss this examination with anyone until the answer key is posted.

Please show all work on these pages. Feel free to use the back of each page as needed. Make sure that your work for each problem is clearly marked, especially on the backs of pages. These pages will be graded and returned electronically, like exercises, and the results will be made available online.

Please note that point values have no correspondence with difficulty. We suggest that you solve the problems that you best understand first.

Please also note that the space I gave you to answer is the space I would need, and not necessarily the space you will need. There is no deduction for more verbose answers (though succinct and comprehensive answers are very much appreciated by your instructor!).
ProblemScoreofMaximum
1a       of 10
1b       of 10
2       of 10
3       of 10
4       of 10
5       of 10
6       of 10
7       of 10
8a       of 10
8b       of 10
9       of 10
Total       of 100

1. Suppose that we know that there are an average of 10 "dirty" blocks in the disk page cache, and that applications are writing an average of 500 blocks per second into the disk page cache.
1. (10 points) What is the average time for a disk write (from the disk page cache to physical disk) in seconds/block? Please show your work.

(This is an alternative way to measure disk write speed, but requires root privilege.)

2. (10 points) Can we compute block read speed via a similar computation? Why or why not?

2. (10 points) Suppose that power fails on a journaled filesystem halfway through a rename request for a file (e.g., via the "mv" command). What is the resulting state of the file after filesystem recovery? Why?

3. (10 points) One subtle detail that we have not covered in class for watermarked journals is what happens when multiple processes try to accomplish journalled writes at the same time. Can we watermark consistency for each process's writes separately, or must we determine watermarks based upon the total sequence of writes from all processes? Why?

4. (10 points) In a Redundant Array of Inexpensive Disks (RAID) array, is the filesystem driver aware that it is running on a RAID device? Why or why not?

5. (10 points) One of the major pain points in managing a hardware RAID5 array is that one's disk choices for replacing failed disks are very limited. Often a hardware raid controller will only accept only disks from a specific manufacturer, and all disks must be the same size. Why?

6. (10 points) When moving a filesystem to a new larger disk, it is a common trick to copy the filesystem bit-by-bit and then expand it to fit. What steps are involved in most efficiently expanding an EXT3 filesystem to utilize more raw disk space?

7. (10 points) In the review session, we mentioned briefly how different the concept of "filesystem integrity" is from "integrity of a user's home directory." What user desires for home directory integrity are not provided by filesystem integrity? Is it possible to construct a filesystem that supplies those user needs? Why or why not?

8. In distributed and multi-core operating systems, the concept of "atomic operations" is largely being replaced by the concept of "serialized sets of operations". A "serialized set of operations" has the property that operations in the set are invoked one by one in an order determined at run time by race conditions, so that no two are ever invoked at the same time. (Warning: this is very different than a "serializable" class in java, etc , which is one whose instances can be written to and read back from files!)
1. (10 points) Is the set of atomic operations that we have discussed in class also a serialized set of operations according to the above definition? Why or why not?

2. (10 points) What is the advantage of thinking about atomic operations in this way? What kinds of situations that might arise in multi-core programming are better expressed in terms of "serialized sets of operations" rather than via our concept of "atomic" operations? Why?