tl;dr: If in doubt, prefer to use zswap. Only use zram if you have a highly specific reason to. In terms of architecture: zswap sits in front of your disk swap, compresses pages in RAM, and automatically tiers cold data to disk. It integrates directly with the kernel's memory management and distributes pressure gracefully. zram is a compressed RAM block device with a hard capacity limit. When you…
tl;dr: Do not use signals in production wherever possible. Use safer alternatives like sockets or varlink instead. See my earlier article for some reasons why. However, if you have to use signals, it is important to know that one cause of production outages is missing the removal of signal senders when removing signal handlers (like SIGHUP). This can cause services to terminate unexpectedly…
tl;dr: Using vfork() , one can create a process in a D state that is not immune to signal interruption. Using fsfreeze , one can create a process in a D state that is immune to signal interruption. But wait, how can any D state process be "not immune to signal interruption"? Isn't the whole point of D state processes that they are uninterruptible? If you are wondering this, read on, and you will…
Link: Meta developer blog As part of my work improving our production stability at Meta , one of the areas that I am frequently involved in is improving how operating system concepts and primitives are being used (or indeed misused). Most of the blog posts that I write on this personal website have to be relatively sanitised: I generally can't talk about details of real incidents or internal…
A few months ago I got a report from a service owner that their service was crashing when trying to access certain files stored in tmpfs. This service provides a way to do things like builds on niche architectures and platforms, and as part of that it retrieves and stores a large cache of required files for the requisite job in /dev/shm , preventing the need to then later fetch the same files for…
Top among the things I'm most glad that I rescued from the office before access was barred for COVID has to be my Advantage 2. It's a weird looking thing, with a design which will grant you strange looks, even from those who we know are the true weirdos – the mechanical keyboard collectors (I kid, I kid!). However, despite its alien aesthetics and anachronistic bulky form, I've really come to love…
tl;dr: pip install gmute ( repo ) Configure ~/.config/gmute as per the documentation Add macro index M '<enter-command>set pipe_sep="\n_PIPE_SEP_\n"<enter><pipe-message>gmute<enter><sync-mailbox>' to your mutt configuration. Press M on a message in a thread you want to mute, and enjoy! Gmail has a neat feature called "mute", which prevents any further replies to a muted thread from entering the…
Link: https://github.com/cdown/psi-notify tl;dr: psi-notify can alert you when resources on your machine are becoming oversaturated, and allow you to take action before your system slows to a crawl. I think we've all had situations where the desktop environment has become so slow as to be unusable, usually because some application has started eating up system resources quickly. Fellow Chrome…
(This post goes into some details about Arch Linux, but the general principles apply the same to other Linux distributions, too.) My old workhorse server that I've used for various tasks over the years is slowly starting to become a bit of a bottleneck. I bought it just after I left high school, so I had no money, and it really shows: % grep -m2 -e 'model name' -e 'bugs' /proc/cpuinfo model name :…
Last week was the final week for this half's performance review at Facebook, where we write summaries of work and impact we and our peers had over the last half year. Naturally, that can only mean one thing: the entire company trends towards peak levels of procrastination, doing literally anything and everything to avoid the unspeakable horror of having to write a few paragraphs of text. My…