CS 416 Exam 2
Spring 2014
See the solutions (6 per page).
100 points – 4 points each
For each statement, select the most appropriate answer. I will give you credit for two incorrect answers.
- A memory management unit (MMU) is responsible for:
(a) Translating a process’ memory addresses to physical addresses.
(b) Allocating kernel memory.
(c) Allocating system memory to processes.
(d) All of the above. - A system uses 32-bit logical addresses, a 16K byte
(214) page size, and 36-bit physical addresses (64 GB memory). What is the size of the page table?
(a) 218 entries (232-14).
(b) 222 entries (236-14).
(c) 24 entries (236-32).
(d) 214 entries. - During a context switch, the operating system
(a) Modifies some page table entries for the new process to reflect its memory map.
(b) Switches a page table register to select a different page table
(c) Modifies the access permissions within the page table for the new process.
(d) Leaves the page table untouched since it is a system-wide resource. - Your process exhibits a 75% TLB hit ratio and uses a 2-level page table. The average memory access time is:
(a) Approximately 1.25 times slower.
(b) Approximately 1.5 times slower.
(c) Approximately 1.75 times slower.
(d) Approximately 2 times slower. - An address space identifier (ASID):
(a) Allows multiple processes to share the same page table.
(b) Enables shared memory among processes.
(c) Associates a process ID with TLB (translation lookaside buffer) contents.
(d) Performs logical (virtual) to physical memory translation for a process. - Page replacement algorithms try to approximate this behavior:
(a) First-in, first-out.
(b) Not frequently used.
(c) Least recently used.
(d) Last in, first out. - Large page sizes increase:
(a) Internal fragmentation.
(b) External fragmentation.
(c) The page table size.
(d) The working set size. - Thrashing occurs when:
(a) The sum of the working sets of all processes exceeds available memory.
(b) The scheduler flip-flops between two processes, leading to the starvation of others.
(c) Two or more processes compete for the same region of shared memory and wait on mutex locks.
(d) Multiple processes execute in the same address space. - The slab allocator allocates kernel objects by:
(a) Using a first-fit algorithm to find the first available hole in a region of memory that can hold the object.
(b) Keeping multiple lists of same-size chunks of memory, each list for different object sizes.
(c) Allocating large chunks of memory that are then divided into pages, one or more of which hold an object.
(d) Using the buddy system to allocate memory in a way that makes recovering free memory easy. - You are using a Buddy System memory allocator to allocate memory. Your initial buffer is 1024 blocks. The following memory chunks are allocated and released: A=alloc(256), B=alloc(128), C=alloc(256), D=alloc(256), free(B), free(C). What is the largest chunk that can be allocated?
(a) 128.
(b) 256.
(c) 384.
(d) 512. - The advantage of a multilevel (hierarchical) page table over a single-level one is:
(a) Page number lookups are faster.
(b) The page table can consume much less space if there are large regions of unused memory.
(c) Each segment (code, data, stack) can be managed separately.
(d) Page permissions can be assigned at a finer granularity. - A USB mouse is a:
(a) Block device.
(b) Character device.
(c) Network device.
(d) Bus device. - On POSIX systems, devices are presented as files. When you send an I/O request to such a file, it goes to the:
(a) Device driver whose name is stored in the device file’s data and read when it is opened.
(b) Device driver, which is stored in the device file and loaded into the operating system when opened.
(c) File system driver (module), which forwards it to the device driver based on the name of the device file
(d) Device driver based on the major and minor numbers contained in the file’s metadata. - The buffer cache
(a) Is memory that is used to copy parameters between the process (user space) and the kernel
(b) Is a pool of memory used by the kernel memory allocator.
(c) Is a pool of memory used to allocate memory to user processes.
(d) Holds frequently used blocks for block devices. - Interrupt processing is divided into two halves to:
(a) Provide a generic device-handling layer in the top half with device-specific functions in the bottom half
(b) Partition work among user processes and the kernel.
(c) Provide separate paths for reading versus writing data from/to devices.
(d) Minimize the time spent in the interrupt handler. - Which disk scheduling algorithm is most vulnerable to starvation?
(a) SCAN.
(b) Shortest Seek Time First (SSTF).
(c) LOOK.
(d) First Come, First Served (FCFS). - Which disk scheduling algorithm works best for flash memory storage?
(a) SCAN.
(b) Shortest Seek Time First (SSTF).
(c) LOOK.
(d) First Come, First Served (FCFS). - A superblock holds
(a) The contents of the root directory of the volume.
(b) A list of blocks used by a file.
(c) Metadata for a file.
(d) Key information about the structure of the file system. - In file systems, a cluster is:
(a) The minimum allocation unit size: a multiple of disk blocks.
(b) A collection of disks that holds a single file system.
(c) A variable-size set of contiguous blocks used by a file, indicated by a starting block number and length.
(d) A set of disks replicated for fault tolerance. - Creating a directory is different than creating a file because:
(a) The contents of a directory need to be initialized.
(b) Ordinary users are not allowed to create directories.
(c) The parent directory’s link count needs to be incremented.
(d) A directory does not use up an inode. - Which of the following is not part of the metadata for a directory:
(a) A link to the parent directory.
(b) Modification time.
(c) Length of directory.
(d) Owner ID. - The File Allocation Table in a FAT file system can be thought of as:
(a) A table of all files with each entry in the table identifying the set of disk blocks used by that file.
(b) A bitmap that identifies which blocks are allocated to files and which are not.
(c) A set of linked lists identifying the set of disk blocks used by all files in the file system.
(d) A table, one per file, listing the disk blocks used by that file. - An inode based file system uses 4 Kbyte blocks and 4-byte block numbers. What is the largest file size that the file system can handle if an inode has 12 direct blocks, 1 indirect block, and 1 double indirect block?
(a) Approximately 64 MB.
(b) Approximately 1 GB.
(c) Approximately 4 GB.
(d) Approximately 16 GB. - When using metadata (ordered) journaling in a journaling file system:
(a) The file system is implemented as a series of transaction records.
(b) The overhead of journaling is reduced by writing file data blocks only to the journal.
(c) The overhead of journaling is reduced by writing file data blocks only to the file system.
(d) All file system updates are written into the journal in the order that they occur. - An advantage of using extents in a file system is that:
(a) They can allow a small amount of pointers in the inode to refer to a large amount of file data.
(b) No additional work is necessary to implement journaling.
(c) They make it easier to find the block that holds a particular byte offset in a file.
(d) They ensure that a file’s data always remains contiguous on the disk. - Differing from its predecessor, ext3, the Linux ext4 file system
(a) Uses block groups .
(b) Uses extents instead of cluster pointers.
(c) Allows journaling to be enabled.
(d) No longer uses inodes.