Tagged articles
14 articles
Page 1 of 1
Deepin Linux
Deepin Linux
Apr 18, 2026 · Fundamentals

Mastering Process Context Switching: What the CPU Actually Does

This article breaks down the fundamentals of process context switching, explaining CPU registers, program counters, the three-step switch routine, trigger conditions, performance impact, monitoring tools, and practical optimization techniques to help interview candidates answer confidently.

LinuxOperating Systemcontext switch
0 likes · 29 min read
Mastering Process Context Switching: What the CPU Actually Does
FunTester
FunTester
Feb 26, 2026 · Backend Development

Why Waiting, Not Computing, Dominates Tail Latency in High‑Concurrency Systems

In high‑concurrency systems, tail latency is driven primarily by waiting on locks, resources, and scheduling rather than raw computation, with phenomena like head‑of‑line blocking, context‑switch overhead, and cache‑coherency costs amplifying unpredictable delays.

backend systemscontext switchhead-of-line blocking
0 likes · 13 min read
Why Waiting, Not Computing, Dominates Tail Latency in High‑Concurrency Systems
Liangxu Linux
Liangxu Linux
Nov 22, 2023 · Operations

How to Diagnose High Context Switches on Linux with vmstat and pidstat

This guide explains what system context switches are, how to monitor them using vmstat and pidstat, provides a practical stress‑ng example that spikes switches, breaks down kernel thread kworker/u256:29-flush-8:0, and clarifies the difference between voluntary and non‑voluntary switches to help troubleshoot performance issues.

Performance Monitoringcontext switchpidstat
0 likes · 12 min read
How to Diagnose High Context Switches on Linux with vmstat and pidstat
Liangxu Linux
Liangxu Linux
Aug 24, 2022 · Operations

How to Diagnose and Fix High CPU Context Switches on Linux

This guide explains what CPU context switches are, how to monitor them with vmstat and pidstat, analyzes a sysbench‑generated load case, examines interrupt sources, and provides practical thresholds and troubleshooting steps to improve Linux system performance.

CPULinuxcontext switch
0 likes · 10 min read
How to Diagnose and Fix High CPU Context Switches on Linux
Liangxu Linux
Liangxu Linux
May 15, 2022 · Fundamentals

Why Linux CPU Context Switches Slow Your System and How They Work

Linux’s multitasking illusion relies on CPU context switches, where the kernel saves and restores registers and program counters for processes, threads, and interrupts, and understanding these mechanisms—including their types, performance costs, and scheduling triggers—reveals why excessive switches can degrade system performance.

CPUOperating Systemcontext switch
0 likes · 11 min read
Why Linux CPU Context Switches Slow Your System and How They Work
MaGe Linux Operations
MaGe Linux Operations
Apr 22, 2022 · Fundamentals

Understanding Linux CPU Context Switches: Impact and Mechanics

This article explains how Linux creates the illusion of multitasking by rapidly swapping CPU registers and program counters, details the three types of context switches—process, thread, and interrupt—and shows why excessive switching can significantly degrade system performance.

LinuxThreadcontext switch
0 likes · 10 min read
Understanding Linux CPU Context Switches: Impact and Mechanics
Tencent Cloud Developer
Tencent Cloud Developer
Mar 10, 2022 · Fundamentals

How to Build a Stackful C++ Coroutine from Scratch: Deep Dive into Context Switching

This article provides a step‑by‑step technical guide to implementing C++ stackful coroutines, covering the design of the owl.context API, low‑level context‑switch principles, register saving conventions on 32‑bit ARM, and complete source code for co_getcontext, co_setcontext, co_swapcontext and co_makecontext with illustrative examples and diagrams.

ARMAssemblySystem Programming
0 likes · 15 min read
How to Build a Stackful C++ Coroutine from Scratch: Deep Dive into Context Switching
Liangxu Linux
Liangxu Linux
Jun 16, 2021 · Fundamentals

Understanding Linux Scheduler: Structures, Policies, and Context Switch Mechanics

Learn how Linux selects the next process for CPU execution by exploring key scheduler structures such as task_struct, sched_class, runqueue, the various scheduling policies (CFS, RT, Deadline, etc.), the scheduling flow, and the low‑level context_switch mechanism that swaps address spaces and registers.

CFSLinuxcontext switch
0 likes · 8 min read
Understanding Linux Scheduler: Structures, Policies, and Context Switch Mechanics
Refining Core Development Skills
Refining Core Development Skills
May 21, 2021 · Fundamentals

Linux Scheduler: Structures, Scheduling Classes, Runqueue, and Context Switch Process

This article explains Linux scheduling fundamentals, describing the task_struct fields, scheduling classes, runqueue organization, the scheduling workflow including flag setting and execution, and the details of the context_switch function that performs address‑space and register state switches.

LinuxOperating SystemScheduling Classes
0 likes · 11 min read
Linux Scheduler: Structures, Scheduling Classes, Runqueue, and Context Switch Process
Liangxu Linux
Liangxu Linux
Dec 1, 2020 · Fundamentals

How Much CPU Time Does a Linux Context Switch Really Cost?

This article measures the CPU time consumed by Linux process and thread context switches, explains the underlying operations, compares simple token‑passing tests with lmbench benchmarks, and shows how to monitor and interpret switch statistics on a production server.

LinuxOperating Systembenchmark
0 likes · 13 min read
How Much CPU Time Does a Linux Context Switch Really Cost?
Qunar Tech Salon
Qunar Tech Salon
Aug 1, 2017 · Databases

MySQL Time Zone Setting Causes High CPU and Slow Queries Due to Mutex Contention

A production MySQL incident showed sudden system CPU spikes and many running threads despite low query throughput, which was traced to the server's time_zone=system setting causing timestamp conversion to lock a global mutex, leading to excessive spin‑locks, context switches, and degraded performance that was resolved by changing the time_zone to a fixed offset.

CPUTime Zonecontext switch
0 likes · 6 min read
MySQL Time Zone Setting Causes High CPU and Slow Queries Due to Mutex Contention