Mehdi Akiki

Posts tagged "kernel"

  • Published on

    Investigation · Part 20 of 20 · From source to a running process

    What Happens When a Process Exits

    A line printed twice, output lost with _exit, a Drop that never runs, a zombie without memory. I followed the end of C and Rust processes with strace and /proc: stdio buffers, exit handlers, exit codes, exit_group, and what the kernel cleans up.
  • Published on

    Investigation · Part 17 of 20 · From source to a running process

    What a System Call Costs, and Why Some Calls Skip the Kernel

    On a performance core of my laptop a function call costs 0.6 ns, getpid as a system call 81 ns, and clock_gettime 14 ns through the vDSO but 108 ns as a real system call. I measured both kinds of cores, counted the calls with strace and dumped the vDSO.
  • Published on

    Investigation · Part 6 of 20 · What survives a crash

    What a Crash in the Middle of a Write Leaves Behind

    One write() call of 1 GiB, killed after 50 ms, left a file of 110 MB. I measured what a single call leaves after kill -9, what another process sees during it, and when appends from four processes mix. Power loss is worse, and I explain why from documentation.
  • Published on

    Investigation · Part 5 of 20 · What survives a crash

    The Zero-Length File Problem and What ext4 Does About It

    In 2009, ext4 users found empty files after crashes, and ext4 got a heuristic called auto_da_alloc. I watched it work on my laptop: a rename over an existing file starts the writeback at once. It protects against the worst case, but it is not durability.