Get the latest tech news

What Makes System Calls Expensive: A Linux Internals Deep Dive


An explanation of how Linux handles system calls on x86-64 and why they show up as expensive operations in performance profiles

We’ll follow the kernel entry and exit path, analyse the direct overheads, and then dig into the indirect microarchitectural side-effects that explain why minimizing system calls is such an important optimization. We will cover the indirect costs of system calls by discussing the different components of the microarchitecture that are impacted, starting from the instruction pipeline, followed by the branch predictor buffers. In practice, this means a single system call can not only drain the pipeline but also leave the branch predictor partially blind, forcing the CPU to relearn patterns and slowing down your code until it recovers.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of System

System

Photo of deep dive

deep dive

Photo of linux internals

linux internals

Related news:

News photo

Criminals broke into the system Google uses to share info with cops

News photo

AT&T tracked employee attendance to find 'freeloaders.' Now, it admits the system is driving workers to the 'brink of frustration.'

News photo

Classic Mac OS System 1 Patterns