<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/what-makes-system-calls-expensive-a-linux-internals-deep-dive-pmcqgjl8m" -->

---
title: What Makes System Calls Expensive: A Linux Internals...
description: System calls are expensive operations that go beyond their kernel code execution cost. When transitioning between user and kernel space on Linux x86-64, the...
canonical: https://daily.dev/posts/what-makes-system-calls-expensive-a-linux-internals-deep-dive-pmcqgjl8m
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: What Makes System Calls Expensive: A Linux Internals Deep Dive | daily.dev
og:description: System calls are expensive operations that go beyond their kernel code execution cost. When transitioning between user and kernel space on Linux x86-64, the...
og:url: https://daily.dev/posts/what-makes-system-calls-expensive-a-linux-internals-deep-dive-pmcqgjl8m
og:image: https://api.daily.dev/og/posts/pMcQGJL8m.png
og:image:alt: What Makes System Calls Expensive: A Linux Internals Deep Dive
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# What Makes System Calls Expensive: A Linux Internals Deep Dive

**[Confessions of a Code Addict](https://daily.dev/sources/codeconfessions)** · 23 min read · 13 upvotes · 1 comments

## Summary

System calls are expensive operations that go beyond their kernel code execution cost. When transitioning between user and kernel space on Linux x86-64, the CPU must drain instruction pipelines, switch page tables and stacks, clear branch predictor buffers, and apply security mitigations against speculative execution attacks like Spectre. These microarchitectural disruptions force the CPU to rebuild its optimization state, making system calls significantly more costly than they appear. The article explores the Linux kernel's syscall handler, measures direct overhead using clock_gettime benchmarks, and explains indirect costs from pipeline draining and branch predictor clearing. Practical optimization strategies include using vDSO, caching values, batching I/O operations, leveraging io_uring, and utilizing eBPF to reduce kernel crossings.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.codingconfessions.com/p/what-makes-system-calls-expensive>

## Community discussion

Top comments from developers on daily.dev.

**@servostar** · 0 upvotes

> Very interesting, despite knowing my faire share of x86 assembly, I never knew about vDSOs until now.

---

Tags: [#performance](https://daily.dev/tags/performance), [#linux](https://daily.dev/tags/linux)

[View this post on daily.dev](https://daily.dev/posts/what-makes-system-calls-expensive-a-linux-internals-deep-dive-pmcqgjl8m)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"What Makes System Calls Expensive: A Linux Internals Deep Dive","url":"https://daily.dev/posts/what-makes-system-calls-expensive-a-linux-internals-deep-dive-pmcqgjl8m","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/what-makes-system-calls-expensive-a-linux-internals-deep-dive-pmcqgjl8m"},"datePublished":"2025-09-16T18:14:15.530Z","dateModified":"2025-09-16T18:14:43.399Z","description":"System calls are expensive operations that go beyond their kernel code execution cost. When transitioning between user and kernel space on Linux x86-64, the...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a73020c2628fe380021087416978e7da?_a=AQAEulh","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a73020c2628fe380021087416978e7da?_a=AQAEulh","isAccessibleForFree":true,"articleSection":"Confessions of a Code Addict","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Confessions of a Code Addict","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/13e0f42f33864f94bf4d8f0e43234afd","url":"https://daily.dev/sources/codeconfessions"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/what-makes-system-calls-expensive-a-linux-internals-deep-dive-pmcqgjl8m","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":13},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"performance,linux","timeRequired":"PT23M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Confessions of a Code Addict","item":"https://daily.dev/sources/codeconfessions"},{"@type":"ListItem","position":3,"name":"What Makes System Calls Expensive: A Linux Internals Deep Dive"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/what-makes-system-calls-expensive-a-linux-internals-deep-dive-pmcqgjl8m","comment":[{"@type":"Comment","text":"Very interesting, despite knowing my faire share of x86 assembly, I never knew about vDSOs until now.","datePublished":"2025-10-01T13:01:31.001Z","url":"https://daily.dev/posts/pMcQGJL8m#c-z8ldn35Am","author":{"@type":"Person","name":"servostar","url":"https://daily.dev/servostar","image":"https://media.daily.dev/image/upload/s--d1aRysjr--/f_auto/v1756837404/avatars/avatar_1ZVWeVewWIl1rE91NVx4e?_a=BAMClqZW0"}}]}
```

