Playback speed
×
Share post
Share post at current time
0:00
/
0:00
Preview

Linux Context Switches: The Truth About TLB Flushes

Is the TLB really flushed during context switches?

The Translation Lookaside Buffer (TLB) is a CPU cache that stores virtual-to-physical page translation mappings. TLB misses are among the most significant performance bottlenecks in modern systems, leading developers to carefully optimize memory layouts to maximize TLB hit rates.

But what happens during process context switches? A common concern is that the Linux kernel might flush the TLB, potentially wiping away all the performance benefits of those optimizations. This video dives deep into the Linux kernel's TLB management during context switches, revealing the true impact on system performance and debunking common misconceptions.

We'll examine actual kernel data structures and mechanisms to understand when and why TLB flushes occur, and explore how modern hardware features help mitigate their impact.

Quick tip: As a non-native English speaker, I speak at a measured pace. Feel free to watch at 2x speed for a more natural viewing experience!


The Linux Context Switching Internals Book

As you might be aware that I am also releasing a series of articles on Linux Context Switching Internals in the form of a short ebook which is currently at an early-access discount at the below link.

Get E-book at 30% discount

As a thank you, I am offering the book at a 50% discount to monthly subscribers, and 100% discount to annual subscribers. Subscribe now and I will send you a discount link:

This post is for paid subscribers

Confessions of a Code Addict
Confessions of a Code Addict Podcast
Deep dives into varied topics on Computer Science including compilers, programming languages, database internals, AI and more. Subscribe for insights and advance your engineering skills!