Kernel 3.6 Fixed My Bufferbloat Problem While Apple Was Busy Losing a Hospital

Kernel 3.6 Fixed My Bufferbloat Problem While Apple Was Busy Losing a Hospital

Tech News btrfs bufferbloat kernel linux networking

Linus Torvalds pushed out Linux kernel 3.6 today, right on schedule, and I've already got it building in a terminal window while I type this. About two months since 3.5, which is roughly the cadence he's kept up for years now. You could set a calendar by it.

I'm not going to pretend I read the whole changelog. Nobody does, not even half the people whose names are on the commits. But two things in this release actually matter for how I use my machine day to day.

First: TCP Small Queues. This is the unglamorous fix for a problem that's been driving me nuts for probably two years, and I didn't even have a name for it until someone explained "bufferbloat" to me on a forum thread. You know the thing where you kick off a big upload or a torrent and suddenly your ssh session turns to molasses, even though your connection isn't technically saturated? That's it. Too much data gets queued up in the network stack, and anything latency-sensitive gets stuck behind bulk transfers that don't care how long they take. TSQ trims how much a single TCP socket is allowed to queue at once. It's not a full cure and it mostly helps the sending side, but I ran a quick test last night, a big scp running in the background while I pinged in another terminal, and the difference was real. Pings that were spiking past 300ms settled down to something sane almost immediately.

Second, and this one's more of a "neat, don't touch it yet" item: early raid5 and raid6 support landed in Btrfs. I want to like Btrfs. I've wanted to like it since it first showed up, mostly because ZFS on Linux was always this awkward licensing dance, and Btrfs promised the same checksums-and-snapshots stuff without the legal headache. Every time I've gone looking for "is it stable now though," the answer has been some version of "mostly, but don't trust your only copy to it." This release doesn't change that. The raid5/6 code is flagged experimental right in the documentation, which in kernel-speak means "we tested it, we think it works, we are not responsible for your data." I'm not putting it anywhere that matters until a couple point releases go by.

There's also VFIO in 3.6, which lets you hand a PCI device straight through to a virtual machine without the older, clunkier passthrough mechanism. I don't have an actual use for it today, but I can already picture wanting it the next time I try to get a GPU into a VM so I can run some dumb bit of Windows software I refuse to dual-boot for.

Compiling on a five-year-old Core 2 Duo that really should've been replaced by now takes a good twenty-five minutes with -j2, which gave me plenty of time to write this and glance sideways at the other thing the entire internet is yelling about this week: Apple Maps. I switched a coworker's iPhone 5 over to it Thursday just to poke around, and it dropped a pin for a hospital about four hundred feet into a lake. Not exaggerating. An actual lake. Tim Cook sent out that apology letter a couple days back telling people to try Bing or MapQuest in the meantime, which is a wild thing for a company to have to publish about its own headline feature. Not really my beat here, I just find it funny that the same week a bunch of kernel folks quietly shipped real networking fixes for free, a much bigger company shipped a maps app that can't find a hospital.

Back to 3.6, though. If you're on anything Debian-based you'll probably be waiting a while for this to land in a stable repo, so today it's building from source or pulling from a PPA that tracks mainline, with the usual caveat about not doing that on a box you can't afford to reinstall. I'm running it on my desktop, not the file server, for exactly that reason. Kernel updates are one of maybe three things I've learned to be genuinely paranoid about after a bad afternoon back in 2010 I still don't love talking about.

Build just finished. Rebooting now and hoping for the best.