Mehdi Akiki

Posts tagged "linux"

  • Published on

    Investigation · Part 6 of 20 · When the benchmark lies

    My Laptop Changed Its CPU Speed During the Benchmark

    I measured the work of one loop and the clock of its core at the same time, for one minute. The clock moved between 3.3 and 4.2 GHz without any change in my program, and the work per cycle stayed the same in every phase. Here is the trace, and what I can do about it on a laptop.
  • 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 6 of 20 · From source to a running process

    Static or Dynamic Linking: What Changes in the Binary and at Startup

    I built the same programs static and dynamic, in C and Rust, and compared files, system calls, start time and shared memory. Static starts twice as fast here, but a static program that looks up an unknown user loaded the shared libc anyway and crashed.
  • 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.
  • Published on

    Investigation · Part 4 of 20 · When the benchmark lies

    Why the First Run Is Slower

    The first iteration of my loop took 145 microseconds and the steady state 12. I separated the causes I could show on my laptop: page faults, cold caches, a pause of 300 ms, lazy binding in C, and the start of the process itself.