Rootconf 2025 Annual Conference CfP

Speak at Rootconf 2025 Annual Conference

Tickets

Loading…

Abhinav Upadhyay

@abhinavu

ASIDs, TLBs, and Context Switching: A Closer Look at Linux on x86-64

Submitted Apr 20, 2025

Description:

Modern CPUs offer features like ASIDs (or PCIDs on Intel) that allow the system to retain TLB state across context switches, potentially improving performance. But how these features are used in practice depends on the operating system, and in Linux, the implementation is intentionally more conservative than what the hardware allows.

In this talk, we’ll explore how Linux on x86-64 handles TLB state during a context switch. We’ll start with a brief explanation of why TLBs matter and how ASIDs are supposed to help. Then we’ll look at how Linux assigns ASID values, how it uses context_id and tlb_gen, and why it deliberately limits the number of ASIDs per CPU—based on tradeoffs involving TLB partitioning, compatibility, and complexity.

This isn’t a benchmarking talk, and it’s not about exposing bottlenecks, it’s about building a clear and accurate mental model of what Linux actually does under the hood, and why.


Takeaways:

  • Understand how Linux manages TLB state across context switches on x86-64
  • Learn the reasoning behind Linux’s limited use of PCID values per CPU
  • Clarify the gap between architectural theory and practical implementation

Audience:

This talk is for engineers interested in operating system internals, performance-sensitive workloads, or anyone who wants a clearer understanding of what happens during a context switch.

Comments

{{ gettext('Login to leave a comment') }}

{{ gettext('Post a comment…') }}
{{ gettext('New comment') }}
{{ formTitle }}

{{ errorMsg }}

{{ gettext('No comments posted yet') }}

Hybrid access (members only)

Hosted by

We care about site reliability, cloud costs, security and data privacy