CSE 120: Homework #4

Fall 2016

Out: Thursday November 17

Due: Thursday December 1 at the start of class
(No late homeworks starting Saturday December 3)

  1. On a Unix-style file system, how many disk read operations are required to read the first block of the file "/usr/include/stdio.h"? Assume that the master block is in memory, but nothing else. Also assume that all directories and inodes are one block in size.

  2. Consider a UNIX-style inode with 10 direct pointers, one single- indirect pointer, and one double-indirect pointer only. Assume that the block size is 4K bytes, and that the size of a pointer is 4 bytes. How large a file can be indexed using such an inode?

  3. Consider a file archival system, like the programs zip or tar. Such systems copy files into a backup file and restore files from the backup. For example, from the zip documentation:
    The zip program puts one or more compressed files into a single zip archive, along with information about the files (name, path, date, time of last modification, protection, and check information to verify file integrity).

    When a file is restored, it is given the same name, time of last modification, protection, and so on. If desired, it can even be put into the same directory in which it was originally located.

    Can zip restore the file into the same inode as well? Briefly explain your answer.

  4. [Silberschatz] Consider a system that supports 5000 users. Suppose that you want to allow 4990 of these users to be able to access one file.
    1. How would you specify this protection scheme in Unix?
    2. Could you suggest another protection scheme that can be used more effectively for this purpose than the scheme provided by Unix?

  5. [Silberschatz] How does a file cache help improve performance? Why do systems not use much larger caches if they are so useful?

  6. Consider a program that executes a loop that issues a read I/O to a storage device and waits I milliseconds for the I/O to complete, and then computes on the data returned for X milliseconds, and then repeats.

    For various values of I and X, compute the percentage of time that the program spends waiting for I/O and fill in the following table. If I and X are both 1 ms, for example, then the program spends 50% of its time waiting for I/O.

    100 ms 10 ms 1 ms 0.1 ms
    25 ms (Data Center)  
    5 ms (HDD)
    I 0.1 ms (SSD)
    0.005 ms (PCM)
    0.001 ms (RAM)