Wednesday, October 27, 2004

Usenet Redux

Natty: He is doing it manually. You know, the 'ol sync;sync;/sbin/reboot thing. I may have exaggerated the 57 times--maybe more like five. The eternal quest to optimize sync is unrelated to sri's obsessions, though, they just incited the fire.

Even smaller sync

Woo hoo, Callum! Callum hand wrote the ELF headers and took my four instruction sync(1) from 360 bytes down to 45 bytes. Nice job, duder.

Oh, and it works.

Are there any more optimizations to make?

Update: Uh oh, this version takes double as long to run (two milliseconds versus one, both cache hot). Since the size is under VM and block device granularities anyhow...

Tuesday, October 26, 2004


sri commented that he runs sync(1) 57 times before rebooting, which prompted me to run strace(1) on sync, notice that sync executes 98 system calls, grumble in disgust, and cry.

The overhead was mostly in dynamically linking in libc and some locale junk, so my first attempt at improvement was just a simple:

int main () { sync (); return 0; }

Which I compiled with -static and ran with a fixed locale. This still used 12 or so syscalls. Far from the ideal two.

The world's greatest sync, however, came on my second attempt, this time in assembly:

.globl _start
movl $36, %eax
int $0x80
movl $1, %eax
int $0x80

Yah, baby. This is what I train for. Compile via

gcc -s -nostdlib sync.S -o sync

Four instructions versus 1,938. Three hundred sixty bytes versus 17 kilobytes. Two system calls versus 98. One millisecond execution versus 32.

shaver says that I suck because if I hand write an optimal ELF preamble, I can get the object size down to well under 100 bytes. Well, ladies and gentlemen, I accept patches. In the meantime, I encourage everyone to replace their gross and bloated sync with this one of stunning beautiful and uncanny ingenuity.

Monday, October 25, 2004


We got inotify 0.14 out last week. Few needed changes remain. I want to redo the locking. Largely, I already have, but the current diff is so large and unwieldly that I can never hope to break it up. Also, I have not even booted it yet. I additionally want to replace our bitmask lookup with the idr layer. I actually already did this; we just need to integrate the patch. Finally, I need to change how we do resource limits, moving from per-device to per-user limits and then removing entirely the open device limit. But even now, inotify really is nice, an excellent example of a file change notification system, full-featured but simple to use.

The Kernel Event Layer has been merged into 2.6.10-rc1. I really hope that drivers and other subsystems start using it, helping to stomp out polling and ushering in a new era of asynchronous instant events. Also, I get a dollar for each kevent.

Landon from MTV's Real World
Landon hates Mel

Took a mini vacation last week, flying back to Florida, renting a car, and driving through the state, seeing family and friends. In Gainesville I watched The Red Sox take Game 7 of the ALCS with some old UF friends and Landon from this season of MTV's Real World. I asked him if it was hard to hide his sexuality all season.

Keith in a Mask
And so the evening went

Had a good time, due in no small part to animal masks. But after too much beer and animal masks and posing as newspaper photographers and the triumpant Sox win, I had to leave, heading south.

Eventually, I arrived in South Florida, spent some time with my parents, cooked a wonderful meal of broccoli and leak soup and veal chops, slept off Gainesville, and flew out of FLL back to BOS.

As intended

Apple's iPod and iTunes really change how I listen to my music, I guess because I never did the mp3 thing and always listened to CD's. Anyhow, I would really like a utility for downloading album covers for all of my CD's. I know that there are hacks and even tools to do this now, but I have not found any that require zero intervention and do it automatically. I have too many albums--I want zero effort. Now, if I am wrong and such a tool does exist, by all means, email me. Second, I really would like iTunes to be able to tell me if I have an existing band for which there is an album I do not have. I picture this being most useful when a new album comes out. You know, like, Hey! Jimi Hendrix just released a new CD and you don't have it yet.

If Apple had an extendable and open API like we do for Beagle, these wishes could more easily become reality.

Nat describes his Robosapien's mannerisms as caveman-like. Boy have robots come so far.

We finally fired Ron Zook. Now hire back Spurrier, the man who lost but five times in The Swamp. I hear he needs a job.

Monday, October 18, 2004


The power of Beagle as an indexing system begs questions on how much we really need structured data--e.g., Storage or WinFS. Certainly, a structured representation of data allows for much richer metadata. In fact, it really gets rid of the concept of metadata altogether, storing the "payload" of your data alongside the "metadata" in one structured and typed schema. Which is, you know, pretty rad.

But structured data has downsides, too, not the least of which is the complexity and change in thought. Another issue is that structured data is more regimented than unstructured data. The structure might be right for the world we have today, but what if it is wrong for the problems of tomorrow?

The change in thought is what we ultimately want, though. A new, richer paradigm for manipulating and maintaining our data. Issues such as structure and databases and the backing store are just that: implementation details. The real beauty is how we can think about our data in radically different ways.

Back on Earth, updated inotify 0.14 went out the other day, and inotify is now in the Gentoo kernel. An emerge on gentoo-dev-source should bring in goodies. Thanks, Greg.

Implemented a FileAdvise C# class, so we can do things like


in Beagle and map down to Linux's posix_fadvise(2) or whatever.

Saw Team America: World Police with Joey and others on Friday. It is pure satire, unrestrained and very funny. A few scenes had me spitting up my drink, and we were all laughing loudly.

Also saw The Motorcycle Diaries a few weeks back. I've always found Che interesting, although I've never fully understood how egregious murder done in the name of social change is romantic. The movie was really good, anyhow.

UF won on Saturday and The Sox had a great comeback last night. We watched the game at Buk's, and those extra innings really killed me.

Saturday, October 16, 2004

If by "dog" you mean "cat" then I am there

Been writing all day. Boring and not even very productive, to be honest.

Yesterday, a three-judge panel of the Eleventh Circuit Court of Appeals ruled unanimously that protesters at a rally next month at the School of the Americas cannot be required to pass through metal detectors.

Judge Gerald Tjoflat (is that really a last name?) wrote We cannot simply suspend or restrict civil liberties until the War of Terror is over, because the War on Terror is unlikely ever to be truly over.

He continues, September 11, 2001, already a day of immeasurable tragedy, cannot be the day liberty perished in this country.

Well said, duder.

Thursday, October 14, 2004


Sitting in my office, in Cambridge, and listening over Shoutcast live to my expat friend, JP, spin in Osaka Japan.

The Internet brings two people half way around the world together. I might as well be listening to him in person, except that this stuff is great hacking music. Anyhow, wow, we are all connected.

I even have a picture:

DJ Stand
jp, dj

Wednesday, October 13, 2004

GNOME Summit

The GNOME Summit was fun. Oh my is the Stata Center a beautiful and unique building. I have always loved Gehry's creations--there is a Stata Center book on my coffee table--but being inside this work of art is just wonderful. Awesome architecture. Organic, alive.

Stata Center
The Stata Center at MIT

My good friend Chris from school was in town for the conference. He stayed at my place, we had a good time, laughing, catching up.

Alex was in town, too, which was, naturally, fun.

Chris, lover of all things related to pirates

The conference had some real highlights: Beagle, Tomboy, Gnoetry, Celestial. I gave a talk on inotify and other kernel happenings. Adam followed up with an overview of device model related changes, including resource management and driver binding, two things that HAL should really appreciate.

There were a lot of new faces to GNOME--heck, I am a newer face than many to GNOME--and it was good to see the first-time visitors and contributors. These folks are really the future of GNOME, and we need to do more to generate and support such hackers. In the kernel community, we do not have to worry about procuring and retaining new blood as much, because we unabatedly have this constant influx of fresh talent. The cabal might stay constant, but the pool of developers changes by the week.

Some played Badminton

The Gators, The Sox...they have both let me down in the last few days. Le sigh.

Monday, October 4, 2004

Flipper Johnny

Released schedutils 1.4.0.

San Francisco
San Francisco, from 101, on the way to Foo Camp

The theme of much inotify hacking continues--fixing bugs, cleanup, and new features. Patches and packages available.

Last night, the Love-Trowbridge algorithm was postulated. This morning yielded a stunning and beautiful proof.