Final Exam Study Guide
Broken Fast File System (BFFS) makes some funny decisions in its design and implementation. Which of the following BFFS decisions differ from classic FFS?
- BFFS tries to place files that were created at nearly the same time near one another on disk - BFFS divides the disk into different groups; each group spans one disk platter's surface
If you double the number of disks in a RAID-1 (mirroring) system from N to 2N (and everything else in the system stays the same, such as the number of replicas), you obtain:
- Double throughput for sequential reads. - Double throughput for sequential writes. - Double throughput for random writes. - Double capacity.
Which of the following are true about memory virtualization:
- In a multiprogramming system the main memory is generally shared among a number of processes. - A hardware mechanism is needed for translating virtual addresses to physical main memory addresses at the time of execution of the instruction that contains the reference.
Which of the following instructions should be protected, i.e., can execute only when the processor is running in kernel mode?
- MOV cr3, src; (move the value in src to control register CR3. CR3 contains the physical address of the base of the page table). - INB (contact I/O device). - print out to an I/O device
Which of the following are elements of a typical process descriptor? (Recall that a process descriptor or process control block is the per-process state kept by the kernel.)
- Process state (blocked/runnable); - The state of the CPU registers - Process ID - base address of the page table
Consider a disk with one surface with 100 tracks, each of which has 100 sectors. The outer track (track=0) contains sectors 0...99, the next track (track=1) contains sectors 100...199, and so forth. Given the workload (a sequence of sectors to read/write) to a particular disk, you are asked to determine what scheduler might service the requests in the order specified. Requests: 0, 500, 200, 400, 300, 100 Completed in order: 200, 300, 400, 500, 100, 0 The disk scheduler is likely:
- SATF with the initial head position near 200 - FSCAN with initial head position near 200 - SSTF with the initial head position near 200
Consider a disk with one surface with 100 tracks, each of which has 100 sectors. The outer track (track=0) contains sectors 0...99, the next track (track=1) contains sectors 100...199, and so forth. Given the workload (a sequence of sectors to read/write) to a particular disk, you are asked to determine what scheduler might service the requests in the order specified. Requests: 0, 300,100, 400, 500, 200 Completed in order: 200, 300, 400, 500, 100, 0 The disk scheduler is likely:
- SSTF - SATF - SCAN
If you double the maximum transfer rate of the disks in a RAID-5 (rotating parity) system (and everything else remains the same, such as the number of disks), you obtain
- Significantly increased (close to double) throughput for sequential reads - Significantly increased (close to double) throughput for sequential writes - Significantly increased (close to double) throughput for random reads.
Which of the following statements are true when the kernel switches execution from the current process to another process?
- The kernel must save the register values (including IP (Instruction Pointer), SP (stack pointer) etc.) of the current process to memory. - The kernel must make the page table of the next process active.
In a typical modern OS, which of the following statements are true about user applications and the kernel?
- The kernel runs at privileged level. - system calls allow user applications to request restricted operation, such as access to input/output devices
Which of the following are true about memory systems based on segmentation or paging:
- The placement policy determines where in real memory a process piece is to reside. - Segmentation does not eliminate external fragmentation. - the larger the segments, the larger memory space wasted to external fragmentation
Which of the following statements are true about processes?
- Timer interrupts are generally required for a kernel to correctly isolate processes
the following are true when comparing deadlock avoidance and deadlock prevention
- deadlock avoidance is more efficient (makes better use of resources and wastes less time) if deadlocks are rare - deadlock prevention is implemented by denying any one of the four conditions for deadlock
An inode is a control data structure that contains ____________ and ____________.
- file attributes - pointers to the disk
If you double the number of disks in a RAID-5 (rotating parity) system from N to 2N (and everything else in the system stays the same), you obtain
- more than double the capacity - better than double throughput for sequential reads - double throughput for random writes
The Broken File System uses a linked allocation scheme, where each block of the file tells you where the next block is. Which of the following are true when using a linked allocation scheme?
- reading an entire file sequentially takes about the same time as readying just the last block of the file - the size of the inode is smaller than in a more typical Unix file system inode
Which type of links do most UNIX file systems support?
- soft links - hard links
Assuming Unix inodes are being used and that nothing is cached in memory, how many disk accesses are required to read the first byte of the file "/usr/local/bin/xemacs"? Choose the correct listing of what is read on each disk access. (inode # below refers to inode number).
1. Read root (/) directory's inode 2. Read content of root directory 3. Read inode # of /usr 4. Read content of /usr to retrieve the inode # of /usr/local 5. Read inode of /usr/local 6. Read content of /usr/local to retrieve inode # of /usr/local/bin 7. Read inode of /usr/local/bin 8. Read content of /usr/local/bin to retrieve inode # of /usr/local/bin/xemacs 9. Read inode of /usr/local/bin/xemacs to identify the beginning of the file 10. Read first byte of the file
Assume a very simple file system, where each inode only has 10 direct pointers, each of which pointing to a single block. The block size is 4KB. Each pointer is 32 bits (4 bytes). What is the maximum file size supported in this file system?
40KB
Assume a very simple file system, where each inode only has one direct pointer, one indirect pointer, and one double indirect pointer. The block size is 4KB. Each pointer is 32 bits (4 bytes). What is the maximum file size supported by this file system?
4KB x (1 + 1024 + 1024 x 1024)
_____________ is when the sequence of instruction is guaranteed to execute as a group, or not execute at all.
Atomic operation
What on-disk data structures does the VSFS use to keep track of allocated data blocks?
Bitmap.
Consider a disk with one surface with 100 tracks, each of which has 100 sectors. The outer track (track=0) contains sectors 0...99, the next track (track=1) contains sectors 100...199, and so forth. Given the workload (a sequence of sectors to read/write) to a particular disk, you are asked to determine what scheduler might service the requests in the order specified. Requests: 0, 100, 350, 200, 500, 400 Completed in order: 0, 100, 350, 200, 500, 400 The disk scheduler is likely
FIFO
The following code executed in two threads of the same process can lead to deadlock no matter how the (shared) semaphores R and S are initialized: void foo( ) { while (1) { sem_wait(S); sem_wait(R); x++; sem_post(S); sem_post(R); } } void foo( ) { while (1) { sem_wait(R); sem_wait(S); x--; sem_post(S); sem_post(R); } }
False. If initialized with larger values than 1, deadlock is not possible. Intuitively, there is no mutual exclusion on the semaphores (as both threads can "own" them at the same time).
For a workload consisting of ten CPU bound jobs of all the same length (each would run for 10 seconds in a dedicated environment), which policy result in the lowest average response time?
Round-robin with a 1000 nanosecond quantum
Consider a disk with one surface with 100 tracks, each of which has 100 sectors. The outer track (track=0) contains sectors 0...99, the next track (track=1) contains sectors 100...199, and so forth. Given the workload (a sequence of sectors to read/write) to a particular disk, you are asked to determine what scheduler might service the requests in the order specified. Requests: 0, 500, 200, 400, 300, 100 Completed in order: 0, 100, 200, 300, 400, 500 The disk scheduler is likely:
SCAN or SSTF with initial disk head position close to 0 - SATF with starting position close to 0
A RAID has the same interface that connects it to the OS as a single disk.
True
The performance improvement of FFS is due to faster access to the same logical blocks as in VSFS.
True
Assume a thread is running in a critical section and the code correctly implements mutual exclusion by acquiring the right semaphore(s) properly initialized. Can the thread be context switched?
Yes, mutual exclusion does not prevent interrupts from happening
A disk is logically represented as
a linear array of blocks
A file descriptor is
a per-process integer used to access files
__________ is the range of memory addresses available to a process.
address space
What on-disk data structures does the VSFS use to keep track of allocated inodes?
bitmap
The "lseek()" call is used to
change the current file offset
_________ is a section of code within a process that requires access to shared resources and that must not be executed while another process is in a corresponding section of code.
critical section
1. The performance improvement of FFS is manifested in fewer disk reads to locate the required block.
false
A physical address is the location of a word relative to the beginning of the program and the processor translates that into a virtual address.
false
A process that is waiting for access to a critical section does not consume processor time when mutual exclusion is implemented with CompareAndSwap-based locks locks.
false
A process that is waiting for access to a critical section does not consume processor time when mutual exclusion is implemented with TestAndSetbased locks.
false
A situation in which multiple threads or processes read and write a shared data item and the final result depends on the relative timing of their execution is a mutual exclusion.
false
All segments of all processes must be of the same length.
false
As the amount of virtual address space grows, the size of each page-table entry (PTE) must grow as well.
false
Deadlock avoidance is more restrictive than deadlock prevention.
false
Files in Unix are a collection on predefined records specific to the type of data they contain
false
If the following conditions are met, then deadlock is guaranteed: 1) mutual exclusion 2) hold-and-wait 3)non-preemption 4)circular wait
false
In Unix Fast File System, a new inode is created every time an existing file is opened.
false
In a multiprogramming system the main memory is not generally occupied simultaneously by multiple processes.
false
It is impossible to have both paging and segmentation in the same system.
false
It is possible in a single-processor system to not only interleave the execution of multiple processes but also to overlap them.
false
Race condition is a situation in which two or more processes continuously change their states in response to changes in the other process(es) without doing any useful work.
false
The 14th block of a file in FFS is included in the inode structure, thus the performance advantages over VSFS
false
The main difference between FFS and VSFS is in the inode data structure
false
The main reason to have a multi-level page table is to speed up address translation.
false
The mutex semaphore is used to implement race condition
false
Using a multi-level page table increases TLB hit rate.
false
Using locks based on hardware primitives such as TestAndSet are better than using semaphores because they can never lead to deadlock
false
hardware support is always needed to synchronize more than two processes
false
multiple threads in the same process share all code and data resources
false
The _________ condition can be prevented by requiring that a process request all of its required resources at one time and blocking the process until all requests can be granted simultaneously.
hold and wait
A _________ is a control structure that contains the key information needed by a Unix operating system for a particular file.
inode
The Unix File System keeps track of all files in an _______________.
inode table
The principal disadvantage of _________ is that the transfer of control from one thread to another within the same process requires a mode switch to the kernel.
kernel level thread
_________ in a computer system is organized as a linear, or one-dimensional, address space, consisting of a sequence of bytes or words.
main memory
Is the following more like policies or more like mechanisms? Saving the register state of a process
mechanism
Is the following more like policies or more like mechanisms? The timer interrupt
mechanism
__________ was designed to keep the processor and I/O devices, including storage devices, simultaneously busy to achieve maximum efficiency.
multiprogramming
_________ refers to the ability of an OS to support multiple, concurrent paths of execution within a single process.
multithreading
The requirement that when one process is in a critical section that accesses shared resources, no other process may be in a critical section that accesses any of those shared resources is _________
mutual exclusion
The __________ is a layer of software between the applications and the computer hardware that supports applications and utilities.
operating system
The ____________ page replacement policy results in the fewest number of page faults
optimal
The __________ shows the frame location for each page of the process.
page table
__________ is transparent to the programmer and eliminates external fragmentation providing efficient use of main memory.
paging
Is the following more like policies or more like mechanisms? Continuing to runt he current process when a disk I/O interrupt occurs
policy
Is the following more like policies or more like mechanisms? How long a time quantum should be
policy
The strategy of deadlock _________ is to design a system in such a way that the possibility of deadlock is excluded.
prevention
A significant point about the ___________ is that it contains sufficient information so that it is possible to interrupt a running process and later resume execution as if the interruption had not occurred.
process control block
A Control/Status register that contains the address of the next instruction to be fetched is called the
program counter
A situation in which multiple threads or processes read and write a shared data item and the final result depends on the relative timing of their execution is a _________.
race condition
The scheduling strategy where each process in the queue is given a certain amount of time, in turn, to execute and then returned to the queue, unless blocked, is referred to as:
round robin
The term ________________ refers to a technique in which a process can do nothing until it gets permission to enter its critical section but continues to execute an instruction or set of instructions that tests the appropriate variable to gain entrance.
spin (busy) waiting
A situation in which a runnable process is overlooked indefinitely by the scheduler, although it is able to proceed, is __________
starvation
When the system spends most of its time swapping pieces rather than executing instructions it leads to a condition known as _____________.
thrashing
Why does the Fast File System distribute the blocks of very large files to various cylinder groups?
to avoid filling up one group
A hardware mechanism is needed for translating virtual addresses to physical main memory addresses at the time of execution of the instruction that contains the reference.
true
A process that is waiting for access to a critical section protected by semaphores does not consume processor time
true
As the size of the virtual address space grows, the amount of space occupied by a linear page table also grows.
true
In a 2-level multi-level page table, each page directory entry should have a valid bit.
true
In a 2-level multi-level page table, the size of the page directory increases as the virtual address space gets larger.
true
In computer science, thrashing occurs when a computer's virtual memory resources are overused, leading to a constant state of paging and page faults, inhibiting most application-level processing.
true
It is possible for one process to lock the mutex and for another to unlock it
true
RAID is a set of physical disk drives viewed by the operating system as a single logical drive.
true
Semaphores can be used to implement locks
true
The Unix File System keeps track of all files in an inode table.
true
The main reason to have TLB is to speed up address translation.
true
Threads of the same process that share some memory need to be synchronized to enforce mutual exclusion.
true
locks can be used to implement semaphores
true
the mutex semaphore is used to enforce mutual exclusion
true
The processor execution mode that user programs typically execute in is referred to as:
user mode
_________ is a storage allocation scheme in which secondary storage can be addressed as though it were part of main memory.
virtual memory