✓ FIFO evicts the oldest page regardless of future use.
This insight is hard to see from code alone because the eviction is implicit in the queue structure.
✓ Page faults occur only when a page is not in memory.
Visualizing each page check clarifies when faults happen and when pages are hits.
✓ The queue order directly controls eviction order in FIFO.
Seeing the queue update step-by-step reveals how insertion order drives eviction.
Practice
(1/5)
1. Which of the following statements best describes a limitation of FCFS scheduling related to waiting time and system responsiveness?
medium
A. FCFS can cause long waiting times for short processes due to the convoy effect
B. FCFS guarantees the shortest average waiting time among all scheduling algorithms
C. FCFS allows preemption to improve responsiveness for interactive processes
D. FCFS scheduling complexity grows exponentially with the number of processes
Solution
Step 1: Evaluate each statement
A is correct because FCFS can cause long waiting times for short processes due to the convoy effect. B is incorrect because FCFS does not guarantee the shortest average waiting time; algorithms like SJF do. C is incorrect because FCFS is non-preemptive and does not allow preemption. D is incorrect because FCFS scheduling complexity is O(n), simple queue processing.
Step 2: Identify the limitation
The convoy effect causing long waiting times for short processes is a key limitation.
Final Answer:
Option A -> Option A
Quick Check:
FCFS is simple but can cause poor responsiveness due to the convoy effect.
Hint: FCFS = simple but convoy effect hurts short jobs
Common Mistakes:
Believing FCFS minimizes average waiting time
Confusing FCFS with preemptive algorithms
Overestimating FCFS scheduling complexity
2. Why might a file system designer limit the number of indirect pointers in an inode rather than allowing unlimited indirect pointers for very large files?
medium
A. Because indirect pointers increase the inode size exponentially, making inodes too large to store efficiently.
B. Because indirect pointers consume more inode space, reducing the number of files the system can track.
C. Because increasing indirect pointers indefinitely would cause excessive disk seek times and degrade performance.
D. Because indirect pointers require complex encryption, increasing CPU overhead.
Solution
Step 1: Understand performance impact of indirect pointers
Each level of indirection adds extra disk reads, increasing seek times and latency.
Step 2: Analyze inode size constraints
Indirect pointers are stored in data blocks, not inodes, so inode size is fixed and not directly affected.
Step 3: Clarify inode size growth
Inode size does not grow exponentially with indirect pointers; pointer blocks are separate.
Step 4: Dispel encryption misconception
Indirect pointers do not inherently require encryption or extra CPU overhead.
Final Answer:
Option C -> Option C
Quick Check:
Performance degradation due to multiple disk seeks is the main limitation [OK]
Hint: More indirection -> more disk seeks -> slower access
3. What is the primary trade-off when choosing a very small time quantum in Round Robin scheduling?
medium
A. Processes with longer CPU bursts get more CPU time per cycle
B. Longer average turnaround time due to processes waiting longer in the queue
C. Reduced fairness among processes with different burst lengths
D. Increased context switching overhead leading to reduced CPU efficiency
Solution
Step 1: Understand impact of small quantum
A very small quantum causes frequent context switches, which consume CPU cycles and reduce efficiency.
Step 2: Analyze other options
Longer average turnaround time due to processes waiting longer in the queue is incorrect because smaller quantum generally reduces waiting time for short processes. Processes with longer CPU bursts get more CPU time per cycle is false; small quantum limits CPU time per cycle for long bursts. Reduced fairness among processes with different burst lengths is incorrect because smaller quantum improves fairness.
Final Answer:
Option D -> Option D
Quick Check:
Small quantum -> more context switches -> overhead ↑ -> efficiency ↓.
Hint: Small quantum -> high context switch overhead
Common Mistakes:
Assuming smaller quantum always improves turnaround time
Believing small quantum favors longer processes
Confusing fairness impact with quantum size
4. Which of the following is a significant drawback of preemptive SJF scheduling compared to non-preemptive SJF?
medium
A. It reduces CPU utilization due to frequent context switches
B. It can cause starvation of longer processes if short jobs keep arriving
C. It always results in higher average turnaround time
D. It cannot handle processes arriving at different times
Solution
Step 1: Understand starvation in preemptive SJF
Shorter jobs can continuously preempt longer ones, causing longer processes to wait indefinitely.
Step 2: Analyze other options
A: While context switches increase, CPU utilization remains high; overhead is a concern but not utilization. B: Preemptive SJF generally reduces average turnaround time, not increases it. D: Preemptive SJF is designed to handle processes arriving at different times.
Final Answer:
Option B -> Option B
Quick Check:
Starvation is a classic drawback of preemptive SJF.
Hint: Preemptive SJF risks starving long jobs if short jobs keep arriving [OK]
5. Why is it generally inefficient to implement all OS services as system calls requiring mode switches?
medium
A. Because mode switches cause significant CPU overhead and latency
B. Because system calls cannot access hardware devices
C. Because user mode has unrestricted access to kernel data structures
D. Because system calls bypass the CPU privilege checks
Solution
Step 1: Understand mode switch cost
Switching from user to kernel mode involves saving/restoring CPU state and flushing pipelines, which is expensive.
Step 2: Why not all services as system calls
Excessive mode switches degrade performance, so only critical OS services use system calls.
Step 3: Why other options are incorrect
Because system calls cannot access hardware devices is false; system calls are the mechanism to access hardware safely. Because user mode has unrestricted access to kernel data structures is false; user mode is restricted from kernel data. Because system calls bypass the CPU privilege checks is false; system calls enforce privilege checks via mode switch.
Final Answer:
Option A -> Option A
Quick Check:
Mode switch overhead limits system call usage [OK]
Hint: Mode switches are costly, so minimize system calls