Tagged articles
context switch
16 articles · Page 1 of 1
The article defines a time slice (time quantum) as the fixed CPU interval allocated to each ready process in a time‑sharing scheduler, explains its role in round‑robin and CFS algorithms, discusses size trade‑offs, Linux implementation details, context‑switch costs, and typical interview follow‑up questions.
CFSOS schedulingcontext switch
0 likes · 9 min read

The article explains how frequent Linux system calls cause costly context switches, kernel checks, and cache/TLB invalidations, presents benchmark code that quantifies the overhead of getpid, open, read, and demonstrates batch I/O, caching, and algorithmic techniques to dramatically reduce those calls and boost high‑performance C++ network services.
Algorithm OptimizationI/O batchingLinux
0 likes · 28 min read

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.
LinuxPerformance OptimizationProcess Scheduling
0 likes · 29 min read

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.
Head-of-line BlockingTail Latencybackend systems
0 likes · 13 min read

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

The article explains the traditional Linux read/write system‑call I/O path, detailing the multiple CPU and DMA copies, context switches, page‑cache mechanisms, and advanced techniques such as zero‑copy, multiplexing, and direct I/O for performance optimization.
DMAI/OLinux
0 likes · 12 min read

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

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.
CPUcontext switchoperating system
0 likes · 11 min read

This article explains how excessive Linux CPU context switches affect system performance and shows step‑by‑step how to monitor and analyze them using vmstat, pidstat, and sysbench, including interpreting voluntary versus involuntary switches and interrupt statistics.
Linuxcontext switchperformance
0 likes · 10 min read

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

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.
ARMC++Low-Level Programming
0 likes · 15 min read

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

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.
LinuxScheduling Classescontext switch
0 likes · 11 min read

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.
BenchmarkLinuxcontext switch
0 likes · 13 min read

This article explores Go's goroutine implementation by dissecting the M‑P‑G model, scheduling strategies, preemption mechanisms, and low‑level context‑switch details, complemented with code snippets and assembly examples to illustrate how lightweight user‑level threads achieve high concurrency.
ConcurrencyM:N modelcontext switch
0 likes · 23 min read

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.
CPUMutexcontext switch
0 likes · 6 min read
