Practice
Solution
Step 1: Understand contiguous allocation characteristics
Contiguous allocation stores all file blocks sequentially on disk, enabling fast sequential and direct access without extra pointers.Step 2: Analyze when fast sequential and direct access to file blocks is required with minimal overhead
Fast sequential and direct access is exactly what contiguous allocation optimizes for.Step 3: Analyze when files are frequently extended or shrunk dynamically during runtime
Contiguous allocation struggles with dynamic file size changes due to fragmentation and need for contiguous free space.Step 4: Analyze when the file system must handle very large files with unpredictable sizes
Large unpredictable files are better handled by linked or indexed allocation to avoid fragmentation and allocation overhead.Step 5: Analyze when minimizing external fragmentation is the highest priority
Contiguous allocation tends to cause external fragmentation, so it does not minimize it.Final Answer:
Option C -> Option CQuick Check:
Contiguous allocation -> fast access but poor flexibility and fragmentation handling.
- Assuming contiguous allocation handles dynamic file sizes well
- Confusing fragmentation minimization with contiguous allocation benefits
Solution
Step 1: Identify starvation characteristics
Starvation happens when a process is perpetually denied access to resources due to scheduling policies favoring others, typically higher-priority processes.Step 2: Analyze each option
A low-priority process never gets CPU time because higher-priority processes keep running correctly describes starvation as a low-priority process being indefinitely postponed. Two or more processes wait indefinitely for each other to release resources describes deadlock, where processes wait on each other. Processes continuously change states without making progress due to resource contention describes livelock, where processes are active but not progressing. A process is blocked waiting for I/O to complete is normal blocking, not starvation.Final Answer:
Option B -> Option BQuick Check:
Starvation involves indefinite postponement due to priority, matching a low-priority process never getting CPU time because higher-priority processes keep running.
- Confusing starvation with deadlock
- Thinking livelock is the same as starvation
Solution
Step 1: Understand TLB purpose
The TLB caches recent virtual-to-physical address translations to speed up address translation.Step 2: Analyze each option
A: High temporal locality means repeated accesses to the same pages, so TLB hits are frequent, improving performance.
B: Single-level page tables are fast, but TLB benefits more when page tables are large.
C: Small physical memory with no paging reduces need for TLB since address translation is trivial.
D: Sequential accesses may not reuse the same pages quickly, reducing TLB hit rate.Final Answer:
Option B -> Option BQuick Check:
TLB effectiveness depends on locality of reference, which is captured by when virtual memory accesses exhibit high temporal locality of page references.
- Assuming TLB is always beneficial regardless of access pattern
- Confusing physical memory size with TLB usefulness
Solution
Step 1: Identify the problem
When a low-priority process holding a critical resource is preempted by a higher-priority process (due to aging), priority inversion can occur because the resource holder cannot proceed to release the resource.Step 2: Understand mitigation
Priority inheritance protocols temporarily raise the priority of the resource-holding process to prevent inversion and reduce blocking time.Step 3: Analyze options
Priority inversion may occur, delaying the critical resource release; mitigation involves priority inheritance protocols correctly identifies priority inversion and its mitigation. Deadlock will occur immediately; mitigation requires disabling aging incorrectly claims deadlock occurs immediately and suggests disabling aging, which is not a solution. Livelock will occur due to continuous priority changes; mitigation involves fixed priorities confuses livelock with priority changes. Starvation will worsen for low-priority processes; mitigation involves removing aging incorrectly states starvation worsens and suggests removing aging, which would increase starvation risk.Final Answer:
Option C -> Option CQuick Check:
Priority inversion + priority inheritance = correct diagnosis and fix.
- Confusing priority inversion with deadlock
- Thinking aging always prevents all scheduling issues
Solution
Step 1: Understand multi-level page tables
Multi-level page tables require multiple memory accesses per lookup, increasing page table access time.Step 2: Impact on EAT
On TLB miss, page table lookup is longer, so miss penalty increases, raising EAT.Step 3: Analyze options
A: Incorrect, TLB does not hide all page table lookup costs.
B: Incorrect, multi-level page tables do not reduce page faults.
C: Correct, longer page table lookup time increases EAT on misses.
D: Incorrect, page table structure affects miss penalty and thus EAT.Final Answer:
Option C -> Option CQuick Check:
Longer page table lookup -> higher miss penalty -> higher EAT.
- Assuming TLB hides all page table lookup costs
- Confusing page fault rate with page table lookup time
