UNIVERSITY OF WISCONSIN-MADISON
Computer Sciences Department
CS 537
Spring 2001
A. Arpaci-Dusseau
Quiz #9: May 2nd -- EOF :)
Name: Student ID #:

Problem 1: Familiar Files (20 points)

Consider a UNIX file system with 12 direct pointers, 1 indirect pointer, 1 double-indirect pointer, and 1 triple-indirect pointer in the i-node. Assume that disk blocks are 8K bytes and that each pointer to a disk block requires 4 bytes.

A)What is the largest possible file that can be supported with this design? Show the expression to get full credit (i.e., you shouldn't calculate the final numeric answer!).











B) How many disk reads will this file system require to read block 14 of the file named /a? Assume that nothing relevant is in the file-cache (e.g., no i-nodes and no data blocks); you can assume that the root directory contains very few entries (i.e., is one block long). To assure full credit, describe each disk read.






Problem 2: Disk Scheduling (25 Points)

A) Rank the disk scheduling algorithms (FCFS, SSTF, SCAN, and C-SCAN) in terms of their fairness in servicing a continuous stream of disk requests; order them from the most fair to the least fair. Consider a general stream of random disk requests, not a particular workload.







B) List the order in which the following requests for a given cylinder number will be serviced for each of the different disk scheduling algorithms: 11, 15, 18, 6, 13, 7, 5. For those algorithms that require assumptions about the initial position of the disk head, assume that the disk head begins at position 9 and is moving in an upwards direction. Also assume that the SCAN and C-SCAN algorithms do not travel to the edge of the disk if there are no requests there.
SSTF:





SCAN:





C-SCAN:





Problem 3: Workloads and FFS (37 Points)

A) Consider modern workloads and access patterns. Circle the word that best completes each sentence.
1.  Most files created by users are ( small / large ).

2.  Most of the file data created by users is allocated to ( small / large ) files.

3.  Within the filesystem, it is important to optimize the bandwidth of 
    ( sequential / random ) access patterns.

B) When is FFS likely to switch to a new cylinder group? Circle ALL that apply.

a.  When allocating a new file.

b.  When allocating the first data block of a file.

c.  After allocating the first 48KB of a file.

d.  When allocating a new directory.
C) How did FFS solve the problem of an unorganized freelist? Circle the ONE best answer.
a.  Periodically reorganizes the free list so that it is sorted.

b.  Inserts each data block in the correct sorted order in the free list
    when the block is freed.

c.  Organizes the free list as a bitmap of free blocks.

d.  Uses a b-tree to point to contiguous regions of free blocks.
D) FFS introduced the concept of a disk fragment (i.e., a partial disk block) to support small files while still maintaining good bandwidth. Given the allocation policy in FFS, which statements are guaranteed to be true when an existing file is extended? Circle ALL that apply.
a.  A file does not span multiple fragments.

b.  A file does not span multiple disk blocks.

c.  A file does not use a partial disk block.

d.  A file does not use more than one partial disk block.

e.  A file does not share a partial disk block with another file.

f.  A file does not use a partial disk block for the middle portion of
    its data.

Problem 4: RAID and LFS (18 Points)

A) Match each RAID level with its primary disadvantage. Each disadvantage should be used only once. Choose the best option for each.
_____ RAID-0        a.  Wastes disk capacity

_____ RAID-1        b.  Complicated calculation of data and parity location

_____ RAID-4        c.  Failure of one disk causes loss of data

_____ RAID-5        d.  Parity disk is performance bottleneck
B) What is the purpose of the i-node map in LFS? Circle the ONE best answer.
a.  To speed up finding contiguous free disk blocks.

b.  To speed up finding contiguous free i-nodes.

c.  To help locate the position of an i-node on disk.

d.  To help compact i-nodes when the disk becomes full.