Nanosecond timestamp collisions are common
I was wondering: how often do nanosecond timestamps collide on modern systems? The answer is: very often, like 5% of all samples, when reading the clock on all 4 physical cores at the same time. As a result, I think it is unsafe to assume that a raw nanosecond timestamp is a unique identifier.
Do not taunt happy fun branch predictor
I recently came up with a "clever" idea to eliminate one jump from an inner loop, and was surprised to find that it slowed things down. Allow me to explain my terrible error, so that you don't fall victim in the future.
Disambiguating Arm, Arm ARM, ARMv9, ARM9, ARM64, AArch64, A64, A78, ...
If you’re new to the Arm ecosystem, consider this a quick primer on terms you likely have seen before but might have questions about.
I spent a week without IPv4 to understand IPv6 transition mechanisms
The time has come to talk about something uncomfortable to a lot of you. You’ve been using legacy methods for far too long. It’s time to move to IPv6. But, of course, there’s a lot more to IPv6 than ‘just’ switching everything over. A lot of systems in the world still haven’t…
Debian riscv64
After many years of effort, I am happy to announce that Debian riscv64 is now an official architecture! This milestone is not the end of the...
Understanding Parquet, Iceberg and Data Lakehouses
In the past few years, I've heard a lot about Avro, Parquet, ORC, Arrow and Feather, but I also keep hearing about Iceberg and Delta Lake. As a "database person", I’ve been struggling to understand all of these different things, and how they relate to Data Lakes and
Butler Virtual Operating System
This post introduces [[butler]], a virtual operating system that runs multi-players applications on the web. In two parts, I present:
Why are Apple Silicon VMs so different?
Before Apple had even released its Developer Transition Kit, virtualisation was already one of the 3 pillars of software support on Apple silicon Macs.
A 1.5GB string
In my previous role, I supported a Java service that operated similarly to RDP or Citrix by enabling remote UI functionality. This service relied on sessions, which consisted of interconnected Java objects that were supposed to be cleaned up either when a user logged out or after a predetermined timeout period.
Curl on 100 Operating Systems
In a recent pull-request for curl, I clarified to the contributor that their change would only be accepted and merged into curl's git code repository if they made sure that the change was done in a way so that it did not break (testing) for and on legacy platforms. In that thread, I could almost … Continue reading…
Linux Namespaces Are a Poor Man's Plan 9 Namespaces
A blog about free software and programming
Firecracker internals: Inside the technology powering AWS Lambda (2021)
You are most likely familiar with AWS Lambda and Fargate — Amazon's serverless computing engines. At its nature, serverless computing introduces quite a challenging task requiring both tight security and great performance. For exactly that matter Amazon came up with its microVM solution called Firecracker .
Build your own Docker with Linux namespaces, cgroups, and chroot
Take a practical approach to containerization as we guide you through the step-by-step process of building your own Docker-like environment using Linux namespaces, cgroups, and chroot. Dive into the code and command examples to gain a deeper understanding of how these technologies work together to create isolated and…
Structures in C: From Basics to Memory Alignment
Structures allow us to combine several variables to create a new data type. Some other languages support the same concept but call it “records”. If you come from object-oriented program…
RabbitMQ vs. Kafka – An Architect’s Dilemma (Part 1)
RabbitMQ and Apache Kafka might appear similar but serve very different needs. Read to learn and make an informed decision suitable for your needs.
Even if you can't write assembly, you can read disassembly
This is a very concise introduction to x86 disassembly. It shows that you probably have all the skills to start reading disassembly right now even if you thought it was too complicated for you. It really isn't, see it for yourself.
Desktop Linux Hardening (2022)
Linux is not a secure desktop operating system. However, there are steps you can take to harden it, reduce its attack surface, and improve its privacy. Before we start… Some of the sections will include mentions of unofficial builds of packages like linux‑hardened, akmod, hardened_malloc, and so on. These are not…
Io uring
Introduced in 2019 (kernel 5.1) by Jens Axboe, io_uring (henceforth uring) is a system for providing the kernel with a schedule of system calls, and receiving the results as they're generated. Whereas epoll and kqueue support multiplexing, where you're told when you can usefully perform a system call using some set of…
Arena allocator tips and tricks
Over the past year I’ve refined my approach to arena allocation . With practice, it’s effective, simple, and fast; typically as easy to use as garbage collection but without the costs. Depending on need, an allocator can weigh just 7–25 lines of code — perfect when lacking a runtime . With the core details of my own…
Flattening ASTs and other compiler data structures
This is an introduction to data structure flattening, a special case of arena allocation that is a good fit for programming language implementations. We build a simple interpreter twice, the normal way and the flat way, and show that some fairly mechanical code changes can give you a 2.4× speedup.
How RocksDB Works
Over the past years, the adoption of RocksDB increased dramatically. It became a standard for embeddable key-value stores.
Farewell EC2-Classic, it’s been swell
It is time to celebrate EC2-Classic, which defined early cloud computing, and which is finally retiring.
Text showdown: Gap Buffers vs. Ropes
I have been working on a hobby project to reimagine the C core of Emacs in Rust. On this journey, I reached the point where I needed some way to represent the text of a buffer. The simplest approach is to just use a large string or array of lines. However these each suffer from poor performance as either the size or…
I wrote a GameBoy emulator for my hobby OS (2022)
The Nintendo GameBoy is an exceptionally well-documented system, perfect for anybody who’d like to take a crack at emulation. Publicly-maintained resources like the Pan Docs make it both approachable and convenient to get an overview of the GameBoy’s address space layout, to understand the mechanics of hardware…
Gnu/Hurd strikes back: How to use the legendary OS in a (somewhat) practical way
How to use the legendary OS in a (somewhat) practical way
Implementing a GPU's programming model on a CPU
SIMT The programming model of a GPU uses what has been coined "single instruction multiple thread." The idea is that the programmer writes t...
"<ESC>[31M"? ANSI Terminal security in 2023 and finding 10 CVEs
This paper reflects work done in late 2022 and 2023 to audit for vulnerabilities in terminal emulators, with a focus on open source software. The results of this work were 10 CVEs against terminal emulators that could result in Remote Code Execution (RCE), in addition various other bugs and hardening opportunities…