CSS NEXUS
CSS Solved Computer Science

CSS 2026Computer SciencePaper II, Q. 5

Modern operating systems balance efficiency and fairness while scheduling processes. Critically evaluate how multi-level feedback queues evolve process priorities over time. Discuss how this design influences CPU utilization and starvation compared to simpler scheduling algorithms.

By CSS Nexus Team ·

Original CSS 2026 Computer Science I paper Original CSS 2026 Computer Science II paper Original CSS 2016–2026 Computer Science paper

This answer to the CSS 2026 Computer Science paper (Paper II, Q. 5) was written by the CSS Nexus team. Read the outline first, then see how each point is developed.

Outline

  • 1. Introduction
  • 2. Overview: goals of CPU scheduling
  • 3. How multi-level feedback queues evolve priorities
  • ✓Multiple queues; new jobs enter at the top; demotion after using the allotment; staying high when giving up the CPU; round robin among equals; longer quanta lower down; priority boost and aging; protection against gaming
  • 4. Worked example
  • 5. Effect on CPU utilization and starvation compared to simpler algorithms
  • ✓FCFS; SJF/SRTF; Round Robin; static priority; multilevel queue; MLFQ
  • 6. MLFQ in real operating systems
  • 7. Critical evaluation
  • 8. Way forward
  • 9. Conclusion

Answer

Introduction

Remzi and Andrea Arpaci-Dusseau describe the multi-level feedback queue (MLFQ) as "an excellent example of a system that learns from the past to predict the future." (Operating Systems: Three Easy Pieces, Arpaci-Dusseau Books, 2018, Chapter 8.) A scheduler never knows in advance how long a process will run or whether it will wait for input. The best-performing algorithm in theory, shortest job first, needs exactly this unknown information. MLFQ solves the problem by observing each process's behaviour and adjusting its priority over time, favouring short interactive jobs without letting long batch jobs starve.

Overview

A CPU scheduler chooses which ready process runs next. It must balance several goals that pull in different directions: high CPU utilization and throughput, low turnaround time for batch work, low response time for interactive users, and fairness, which includes preventing starvation. Silberschatz, Galvin and Gagne explain that no single simple algorithm meets all of these goals, which is why general-purpose systems use multilevel designs. MLFQ was first used in Fernando Corbató's Compatible Time-Sharing System (CTSS) at MIT in 1962, work for which Corbató received the Turing Award in 1990. (Reference: Silberschatz, Galvin and Gagne, Operating System Concepts, 10th ed., Wiley, 2018, Chapter 5; Corbató, Merwin-Daggett and Daley, "An Experimental Time-Sharing System", AFIPS Spring Joint Computer Conference, 1962.)

Scheduling goals

  1. High CPU utilization
  2. High throughput
  3. Low turnaround
  4. Fast response
  5. Fairness without starvation

How multi-level feedback queues evolve process priorities

1. Several queues with different priorities.

MLFQ keeps a number of ready queues, each at a different priority level. The scheduler always runs a job from the highest non-empty queue, so a job in a higher queue pre-empts any job below it. (Reference: Arpaci-Dusseau, 2018, Rule 1.)

2. New jobs enter at the top.

Since the scheduler knows nothing about a new process, it optimistically assumes it is short and interactive and places it in the highest-priority queue. If the job really is short, it finishes quickly, which approximates shortest job first without knowing burst lengths. (Reference: Arpaci-Dusseau, 2018, Rule 3.)

3. Demotion after using the time allotment.

If a job uses up its full time allotment at a level, it is treated as CPU-bound and moved down one queue. A long-running computation therefore sinks steadily towards the bottom, where it will not delay interactive work. (Reference: Arpaci-Dusseau, 2018, Rule 4.)

4. Staying high when giving up the CPU.

A job that blocks for input/output before its quantum expires, such as an editor waiting for a keystroke, keeps its priority. Interactive and I/O-bound processes thus remain in the top queues, giving users fast response and keeping I/O devices busy. (Reference: Silberschatz et al., 2018, Section 5.3.6.)

5. Round robin among equals.

Jobs at the same priority level share the CPU in round-robin fashion, so no job at a given level monopolises it. (Reference: Arpaci-Dusseau, 2018, Rule 2.)

6. Longer quanta in lower queues.

Higher queues use short time slices (for example 8 ms) for responsiveness, while lower queues use longer slices (16 ms, 32 ms, or first-come-first-served at the bottom). CPU-bound jobs then run for longer stretches with fewer context switches, which improves throughput. (Reference: Silberschatz et al., 2018, Section 5.3.6.)

7. Priority boost and aging.

Without a correction, a steady stream of interactive jobs could keep low queues waiting forever. MLFQ therefore periodically moves all jobs back to the top queue (a priority boost), or gradually raises the priority of jobs that have waited long (aging). This guarantees that every process eventually runs and lets a job that has changed from CPU-bound to interactive regain high priority. (Reference: Arpaci-Dusseau, 2018, Rule 5.)

8. Protection against gaming.

An early design kept a job's priority whenever it gave up the CPU before its quantum ended. A clever program could issue a trivial I/O just before the quantum expired and stay at top priority forever. The fix is to account for the total CPU time used at a level, regardless of how many times the job gave up the CPU; once the allotment is used, the job is demoted. (Reference: Arpaci-Dusseau, 2018, revised Rule 4.)

Life of a process in MLFQ

  1. 1

    Enters the top queue

  2. 2

    Blocks for I/O: keeps priority

  3. 3

    Uses full allotment: demoted

  4. 4

    Runs with longer quanta lower down

  5. 5

    Periodic boost returns it to the top

Worked example

Consider three queues: Q0 with an 8 ms quantum, Q1 with a 16 ms quantum and Q2 running first-come-first-served. Process A is a CPU-bound job needing 60 ms; process B is an editor that runs 2 ms and then waits for a keystroke.

- A enters Q0, runs 8 ms, and is demoted to Q1. It runs 16 ms there and is demoted to Q2, where it receives the remaining 36 ms whenever Q0 and Q1 are empty.

- B enters Q0, runs 2 ms and blocks. Because it never exhausts its allotment, it stays in Q0, so every keystroke is answered almost immediately, pre-empting A.

- If many editors kept Q0 busy, A could wait indefinitely in Q2; a boost every, say, one second moves A back to Q0 and ensures it progresses.

The scheduler has thus "learned" that A is long and B is interactive, using only observed behaviour.

Effect on CPU utilization and starvation compared to simpler algorithms

First-Come, First-Served (FCFS).

FCFS is simple and cannot starve any process, but it suffers from the convoy effect: one long CPU-bound job holds the CPU while short I/O-bound jobs wait, leaving I/O devices idle and lowering overall utilization. MLFQ pre-empts the long job, so I/O-bound jobs keep devices busy alongside the CPU.

Shortest Job First / Shortest Remaining Time First.

SJF gives the minimum average waiting time but needs burst lengths that must be predicted (for example by exponential averaging) and can starve long jobs indefinitely. MLFQ approximates SJF's good turnaround without needing predictions, and its boost or aging rule prevents starvation.

Round Robin (RR).

RR is fair and starvation-free, with good response time, but it treats all jobs alike. A short quantum causes heavy context-switch overhead; a long one degrades to FCFS. Turnaround for short jobs is also poor when many long jobs share the queue. MLFQ uses RR within each level but varies the quantum, combining RR's fairness with better turnaround and less overhead.

Static priority scheduling.

Fixed priorities make it easy to favour important work but can starve low-priority processes; the classic anecdote is a low-priority job on the IBM 7094 at MIT found unrun when the machine was shut down in 1973, years after it was submitted. MLFQ makes priority dynamic and adds aging, removing this risk. (Reference: Silberschatz et al., 2018, Section 5.3.4.)

Multilevel queue (without feedback).

Processes are permanently assigned to queues (system, interactive, batch). This is low-overhead but inflexible, and lower queues can starve. MLFQ's ability to move processes between queues is exactly what fixes this.

Compared with MLFQ

  • 01FCFS: convoy effect, low utilization
  • 02SJF: needs predictions, starves long jobs
  • 03Round Robin: fair but overhead and poor turnaround
  • 04Static priority: starvation
  • 05Multilevel queue: rigid
  • 06MLFQ: adaptive, boost prevents starvation

Overall effect on CPU utilization.

By keeping I/O-bound jobs at high priority, MLFQ ensures they quickly issue their next I/O request, so the CPU and devices work in parallel. Long quanta for CPU-bound jobs cut context-switch overhead. Together these raise utilization and throughput. On starvation, pure MLFQ can starve low-priority jobs, but the priority boost or aging rule bounds the waiting time, so a correctly tuned MLFQ is starvation-free.

MLFQ in real operating systems

Variants of MLFQ underlie many production schedulers. Windows uses 32 priority levels and temporarily boosts threads that complete I/O or belong to the foreground window, then lets the boost decay. Solaris uses a time-sharing dispatch table that lowers a thread's priority when it uses its full quantum and raises it when it returns from sleep. FreeBSD's ULE scheduler and macOS also rely on dynamic priority adjustment. Linux used interactivity heuristics in its O(1) scheduler (2002), then replaced them with the Completely Fair Scheduler in 2007 and EEVDF in kernel 6.6 (2023), which pursue fairness through virtual runtime rather than multiple queues. (Reference: Yosifovich, Ionescu, Russinovich and Solomon, Windows Internals, Part 1, 7th ed., Microsoft Press, 2017; Silberschatz et al., 2018, Section 5.7.)

MLFQ in practice

  • CTSS 1962
  • Unix and Solaris dispatch tables
  • Windows priority boosts
  • Linux moves to CFS and EEVDF

Critical evaluation

MLFQ's great strength is that it needs no advance knowledge, yet it delivers both quick response for interactive jobs and reasonable throughput for long ones. Its weaknesses lie in tuning and complexity. The number of queues, the quantum at each level, the allotment before demotion and the boost interval all interact, and there is no formula for choosing them: a boost interval that is too long allows starvation, while one that is too short gives CPU-bound jobs too much time and hurts interactivity. Its heuristics can still be fooled, for instance by processes that alternate between behaviours, and it gives no proportional-share guarantee, so one user running many processes can capture more CPU than others. Fair-share schedulers such as lottery, stride and CFS give stronger fairness guarantees, while real-time systems need deadline-based algorithms like EDF instead. MLFQ is therefore best seen as an excellent general-purpose compromise rather than a universally optimal design.

Way forward

1.

Use the revised accounting rule (total CPU time per level) to prevent gaming.

2.

Choose boost intervals from measured workloads, not fixed guesses.

3.

Allow administrators to set priority hints, such as the Unix `nice` value, to guide the scheduler.

4.

Combine MLFQ with fair-share controls (control groups) so that users and containers get guaranteed CPU shares.

5.

Use separate real-time classes with deadline scheduling for audio, video and control tasks.

6.

Make schedulers multicore-aware, with per-CPU queues, load balancing and cache affinity.

7.

Account for energy, scheduling across big and little cores on mobile processors.

8.

Explore learning-based schedulers that tune parameters automatically from workload behaviour.

Conclusion

As the Arpaci-Dusseaus put it, MLFQ "learns from the past to predict the future." By starting every job at high priority, demoting those that consume their allotment, keeping I/O-bound jobs high and periodically boosting everyone, it approximates shortest job first without knowing burst times and delivers high CPU utilization with fast response. Compared with FCFS, SJF, round robin and static priority, it avoids the convoy effect, rigid queues and starvation, provided its boost or aging rule is properly tuned. That balance of efficiency and fairness is why its ideas, born in CTSS in 1962, still shape the schedulers of modern operating systems.

Tags

Browse every CSS Computer Science solved past paper or the full library of CSS solved past papers, and compare with the original CSS 2026 Computer Science question paper.

Corrections and discussion

Nothing here yet. Spotted a mistake in this answer, or have a suggestion? Tell us below.

Add your comment, correction or suggestion

Everything is checked by our team before it appears. Please keep it respectful and on topic.

Your rating (optional)

Answered this question differently?

Submit your own answer — approved answers are published with your name.

Submit your answer

Get new solved papers on WhatsApp

Follow the CSS Nexus channel to hear first when new answers are published.

Follow our WhatsApp channel