Senior Thesis 2024
Computer Science Department
School of Computer Science, Carnegie Mellon University



Tage Against the Context Switch

Tony Yu

Senior Thesis

May 2024

Thesis Document


Keywords: Operating Systems, Hardware-Software Co-Design

Modern computers must have the capability to handle hundreds of processes. A core component of this capability is the context switch, wherein the state of a process is saved so that execution can be paused and resumed at a later point, freeing the CPU for use by another process. Context switches allow processes to share CPUs and help computers to hide stalls from blocked processes. However, context switches are computationally intensive, and typically have a negative impact on system performance. Despite this, context switches are extremely prevalent in all computer systems, as they are necessary to handle I/O interrupts, system calls, VM-exits, core scheduling and preemption, and other multiprocessing operations.

A key design paradigm is that core scheduling and preemption is a responsibility delegated to the operating system. Using user-space instrumentation, we quantify the consequent context switching and kernel thread preemption overheads and show that they are significant in common multiprocessing settings. We also present Nemo, a novel CPU simulator for the Structural Simulation Toolkit. We also propose means by which such overheads can be eliminated from modern computing systems.

37 pages

Advisor
Dimitrios Skarlatos


Return to: SCS Technical Report Collection
School of Computer Science

This page maintained by reports@cs.cmu.edu