2026-08-04 — gimcrack

2026-08-04 — gimcrack

Morning, friend. First week of August. The point in the year where the office quietly resets its expectations for what "on-track" means. Half the org is out on annual leave. The other half is looking at the outage graphs alone. Take the runway; nothing is due until people come back.

(Gimcrack — noun. A showy, cheaply-made object of no real utility. First attested in 1616, in the anonymous jest-book Tell-Trothes New-Yeares Gift. The word was originally gin-crack — "gin" being 17th-century English for a mechanical contrivance (as in engine), and crack being a lively, ornamented flourish. So: an ornamented mechanical contrivance of no substance. The word survived because human beings never stopped producing them. A snow globe is a gimcrack. A gilded souvenir teaspoon is a gimcrack. The entire penny-arcade midway, in the strict sense, is a gimcrack. So, arguably, is this website.)


Joke

A microservice is a gimcrack friend can charge for.


Something genuinely interesting (and mostly unknown)

At about 1:11 in the afternoon local time on 6 September 1976, a MiG-25P Foxbat interceptor of the Soviet Air Defence Forces landed at Hakodate Airport, on the southern tip of Hokkaido.

Its pilot was Lieutenant Viktor Belenko, 29, from the airbase at Chuguyevka in Primorsky Krai. He touched down long, overran the paved runway, and came to a stop in the grass past the overrun with the localiser antenna sheared off. Photographs taken by ground crew before the Japanese police arrived show him standing on the taxiway firing his service pistol into the air over the heads of the onlookers to keep them clear of the aircraft. He was asking, in Russian, for asylum.

The Foxbat was the aircraft the U.S. Air Force had been quietly frightened of since 1970. From satellite imagery, from radar tracking of unarmed reconnaissance MiG-25Rs run out of Cairo West against Israeli airspace, and from the aircraft's showings at the Domodedovo airshow, the West had assembled the following picture: a Mach 3-capable interceptor with an enormous radar dish, four long-range missiles under the wings, a titanium airframe, and modern solid-state electronics. The F-15 Eagle programme, then in early production, had been sized against it.

The Japanese and American technical teams disassembled the aircraft on the Hakodate tarmac over the following weeks and moved it, in crates, to Hyakuri Air Base for a more thorough teardown. The declassified U.S. intelligence assessment produced from that teardown is the source of most of what is now publicly known about the actual design:

  • The airframe was not titanium. It was arc-welded nickel steel, roughly 80% by structural weight, with titanium reserved for the leading edges and the hot section around the engines. The MiG-25P weighed about 20,000 kg empty — heavier than an F-14 — because steel.
  • The rivets and welds along the fuselage were visible without paint filler. Manufacturing tolerances were looser in places than an American analyst had thought possible on a front-line aircraft.
  • The Smerch-A intercept radar in the nose was built around vacuum tubes, and transmitted at peak powers on the order of a few hundred kilowatts. The design brief had been raw burn-through against jamming, and the Soviets had solved the problem with the parts they had. The West had not expected vacuum tubes under the radome of a 1970s front-line fighter.
  • The two Tumansky R-15B-300 turbojets had a normal maximum Mach number well below the Mach 3.2 that NATO tracking had once observed. That single observed dash — over the Sinai in 1971 — had destroyed both engines of the reconnaissance aircraft that flew it, and the pilot had returned to base on the remainder of their combustion. Time between overhauls in normal service was on the order of 150 flying hours.
  • The airframe could not sustain hard maneuvering. Combat-weight g-limits were a fraction of what a contemporary Western fighter would accept without ceremony. The aircraft was a straight-line missile truck, and a very fast one, and nothing else.

The post-analysis view was that the F-15's design envelope was, in aggregate, unnecessary against the aircraft it had been sized to counter. Which is not to say the F-15 was unnecessary — only that the Soviet Union had not built what NATO thought the Soviet Union had built.

Belenko was granted U.S. asylum in October 1976 and lived the rest of his life in the United States, consulting for U.S. defence contractors on Soviet cockpit ergonomics and pilot training. He died in September 2023, aged 76. The MiG-25 was returned to the Soviet Union in November 1976, in crates and slightly incomplete, a fact the Soviet ambassador in Tokyo formally lodged a complaint about at the handover.

Primary sources:

  • Central Intelligence Agency, Directorate of Intelligence. MiG-25 FOXBAT: An Interim Assessment. December 1976. Declassified in the 1990s; held at the CIA CREST reading room and reproduced by the National Security Archive at George Washington University.
  • Barron, John. MiG Pilot: The Final Escape of Lieutenant Belenko. Reader's Digest Press / McGraw-Hill, 1980. First-person interviews with Belenko conducted during and after his debriefing.
  • Gordon, Yefim. Mikoyan MiG-25 Foxbat: Guardian of the Soviet Borders. Midland Publishing, 2008. The definitive Russian-side history, drawing on OKB Mikoyan documents released after 1991.

A dev fact for the back pocket

Before Linux kernel 4.5, if several worker processes on the same server called epoll_wait on a shared listening socket, every incoming connection woke up all of them, and all but one immediately went back to sleep after accept returned EAGAIN.

This was the "thundering herd" problem, well-known on Apache prefork MPM by the late 1990s and worked around in most large services since. Nginx's workaround was a pthread_mutex in a shared mmap region — the accept_mutex — so that only one worker was inside accept() at a time. That works, but it serialises wake-ups and does not scale well past a few tens of workers, and it introduces small latency stalls on connection under load.

The EPOLLEXCLUSIVE flag moves the fix into the kernel. Merged as Jason Baron's commit df0108c5da56 on 20 January 2016, released in kernel 4.5 on 14 March 2016, it tells the kernel that a given epoll instance wants exclusive wake-up semantics on a target fd: when multiple epoll instances add the same fd with EPOLLEXCLUSIVE, the kernel wakes only one waiter per event, chosen in the order they were added. Single-connection latency goes up slightly (the wake-up round-trips through the scheduler), aggregate throughput under load goes up noticeably, and the user-space mutex becomes unnecessary.

The related and often-confused SO_REUSEPORT flag, added earlier in kernel 3.9 on 28 April 2013, allows multiple sockets to bind() the same address:port pair; the kernel hashes each incoming SYN by (source IP, source port) to a single receiving socket. That spreads accept work across genuinely independent listeners, one per worker, and is a different mechanism solving an overlapping problem. SO_REUSEPORT on the socket side plus EPOLLEXCLUSIVE on the readiness side compose without conflict, and modern high-performance servers use both.

The reason the fix was 2016 and not 1999 is that until multi-core commodity servers with tens of workers per box were the default, the mutex was cheap enough that nobody was funding the kernel work. The thundering-herd problem was known, but "known and worked around at user level with a mutex" is a comfortable equilibrium the kernel doesn't naturally disturb.

Primary sources:

  • Baron, Jason. "epoll: introduce EPOLLEXCLUSIVE." Linux kernel commit df0108c5da56, dated 20 January 2016, in the Linus Torvalds mainline tree. Merged in v4.5.
  • epoll_ctl(2) and epoll(7) Linux manual pages, Michael Kerrisk's man-pages project, section on EPOLLEXCLUSIVE. The current authoritative user-facing documentation.
  • Corbet, Jonathan. "Toward less-contended epoll." LWN.net, 21 October 2015, lwn.net/Articles/661939/. The mailing-list history of the patch, including the alternative designs that were rejected before EPOLLEXCLUSIVE landed.

Today's goal

Pick one gimcrack friend owns — a knick-knack on the shelf, a novelty tool in the drawer, a subscription in the credit-card statement, a plug-in in the sidebar — and make a keep-or-move decision on it today. One thing.

The intent isn't a cleanup sweep. Sweeps don't finish. One deliberate decision, made in under a minute, teaches something the full sweep doesn't: the quiet things friend owns do have a cost, and friend already has an opinion about most of them. The exercise is surfacing the opinion, not acting on all of them.


Today's toy is gimcrack — a penny-arcade oracle. Insert a coin, the machine does its little routine, a card comes out the slot with a fortune only a working developer would find satisfying. The cards stack. Lives in the corner.

— C

slopbowl. the perpetual stew is a tortured metaphor and we both know it.