Assignment 9: Chapter 9 and 10

This assignment is to be completed individually, not as a group.

Please make sure that you're using the same edition of the book. There is no guarantee that older editions use the same numbering for problems. Please submit a single tar file.

Note that problems may intentionally differ slightly from the ones shown in the book.

  1. 9.1: Give an example that illustrates the problem with restarting the block move instruction (MVC) on the IBM 360/370 when the source and destination regions are overlapping. (There can be multiple concurrent processes.)
  2. 9.4: A certain computer provides its users with a virtual-memory space of 230 bytes. The computer has 220 bytes of physical memory. The virtual memory is implemented by paging, and the page size is 4096 bytes. A user process generates the virtual address 11123456. Explain how the system establishes the corresponding physical location. Distinguish between software and hardware operations.
  3. 9.5: Assume we have a demand-paged memory. The page table is held in registers. It takes 6 milliseconds to service a page fault if an empty page is available or the replaced page is not modified, and 30 milliseconds if the replaced page is modified. Memory access time is 80 nanoseconds. Assume that the page to be replaced is modified 60 percent of the time. What is the maximum acceptable page-fault rate for an effective access time of no more than 200 nanoseconds?
  4. 9.8: Discuss situations under which the most frequently used page-replacement algorithm generates fewer page faults than the least recently used page-replacement algorithm. Also discuss under what circumstance the opposite holds.
  5. Using the Love book and other sources, summarize the virtual memory mechanisms used in Linux 2.6. In particular, how are pages replaced? Is there a distinction between 'clean' and 'dirty' pages? Can parts of the kernel be swapped out?
  6. 9.16: Is it possible for a process to have two working sets, one representing data and another representing code? Explain why this would or would not be helpful.
  7. How do you construct links in Linux (or Solaris)? For each method, compare

    You should demonstrate the behavior in each case by showing a test case and the resulting error message or output.

  8. As mentioned in class, Unix supports files with 'holes'. Write a test program that illustrates this behavior, using lseek(), write() and stat().
  9. Implement advisory file locking between two processes, using flock(). You should also investigate what happens after a process exits. What happens when a second process request a lock? Your test program should allow the user to configure the lock option (LOCK_SH, LOCK_EX, ...).
  10. Write a test program that investigates what happens when a file is deleted while it is open. In other words, a program opens the file, deletes it via unlink(), writes additional data to the file and then closes the file. When does the file disappear, if ever? What does stat() show after each step?
  11. Compare the performance of read() and fread() when reading a large file (100 MB or so). You should measure the performance, i.e., the time to read the file from beginning to end, for read blocks of 100, 200, 512, and 1024 bytes.
  12. Investigate when NFS "stale file handles" occur, even though NFS is supposedly stateless.

Last updated by Henning Schulzrinne