Friday, July 29, 2005

Ginger Carrot

Released schedutils version 1.5.0, which adds ionice(1), a tool for manipulating I/O priorities.

Tuesday, July 19, 2005

Remarkable Bird, the Norwegian Blue

Since inotify system call stubs are not yet in glibc, I put up a header file to add them.

I also put up first-draft minimalist inotify man pages.

At the Kernel Summit. Linus on changing the default I/O scheduler to CFQ: It better not eat anybody's disks, because when someone loses his porn collection, I hear about it for years.

The wise and noble Jon Trowbridge is speaking at OLS on Friday at 1130 on Beagle and--he assures me--the recently-merged inotify. The effort we exert to model the file system in user-space, allowing the 'ol pooch to do what he does best, is pretty impressive and should make for an interesting talk.

Humorous Monty Python air to Chief Justice Rehnquist's non-retirement statement: I'm not dead!

Sunday, July 17, 2005

Hall Ave, not Street

Nat made it back in time for the awesome parties last night.

Potter Books
Look at all those Harry Potter deliveries

Off to Ottawa for Kernel Summit.

Update: Marcello and I just barely survived the flight from hell.

Saturday, July 16, 2005

Tour de Nat

Every generation has its heroes. Men and women of selfless valor, pure heart, true intention. Motivated by altruism and justice, guided by faith, these men and women are our leaders, our inspiration, and our hope for a better tomorrow.

And then there are some men who just want to prove other men wrong.

The Tour de Nat is more than a 120 mile one-man race from posh Commonwealth Ave in Boston to the rustic tip of Cape Cod. It is the melding of man and machine, one man's quest to find himself and prove that nay-saying bastard wrong. It is also a little bit retarded and entirely unnecessary.

As promised, I am narrating Nat's campaign in real-time, complete with live photo and video.

0400. Nat has slept only an hour, if at all. The excitement too strong to quell, he lies awake despite the NyQuil.

0420. Nat departs his home on bike, groggy from the NyQuil, riding down Comm Ave toward his destiny. The fate of a nation lies in his hands. Video (you can play these with RealPlayer).

0600. In the town of Pembroke, a gang of school boys surround Nat and demand a toll for riding through their suburban neighborhood. Nat, in lieu of material payment, assuages them with advice: Stay away from prunes. Video.

0630. Nat reaches Plymouth, MA. Plymouth has great historical significance to America: As the birthplace of Dean Acheson, it was the site of the Crittenden Compromise and thus the subsequent Battle of Plattsburgh. Video.

0729. Nat finds a garage sale. Always eager to make a deal, he negotiates the purchase of an antique tea set and cheetah fur-lined picture frame for a steal of a price.

Garage Sale

0735. Nat realizes he is unable to carry his newly purchased treasure on his bike. He burns the junk in a fit of rage.


0811. O'Glorious Day. Ahead of schedule, Nat reaches the Sagamore Bridge, The Gateway to Shangri La. The bridge was constructed two and a half miles from the eastern end of the Cape Cod Canal's land cut. A cantilever-type draw bridge, the Sagamore Bridge was built by socialists, the Public Works Administration, and opened to The People on 22 June 1935.


0812. Nat takes a twenty minute break. At this point, he has riden an uncountable number of miles (about sixty). He is at Cape Cod.


0820. Nat has delusions of Don Quixote.


0923. Nat reaches Lothrop Hill Cemetery, ostensibly named after the famed American historian, John Lothrop Motley. Nat reflects on his journey. When I left Boston, I was but a boy. What art thou now?


1014. Nat calls me, the brutal wind of The Cape so strong I can barely make out his gasps. Over my breakfast of eggs, sausage, bacon, caviar, truffles, brotchen, and cheese--oh, and mimosas--I scribble down his coordinates: N 41.75108 W 70.10127. He is halfway up The Cape, just outside of Brewster. Joey curses at the news; he can already taste the crow. Video.

1029. On the phone, I ask Nat for a picture of his noble steed. He sends it posthaste.


1139. No one has heard from Nat in over an hour. Joey and I begin to wonder what he left us in his will.

1159. I call off the search squad as Nat restores contact with a brief SMS: just hit 100 miles. dangerously hot. I need a peloton.

1201. Joey decides to up the ante:

Joey Shaw: you misspelled "Cod"
Robert Love: dude, he is going to make it. admit defeat.
Joey Shaw: i bet that he can't ride back in time for the parties
Joey Shaw: it can't be done
Robert Love: he is taking the ferry back.
Joey Shaw: like a pussy
Joey Shaw: let me text him an updated challenge
Robert Love: "no hands"

1205. Nat declines Joey's updated challenge, citing the debilitating heat.

1209. Nat phones in fresh coordinates: N 41.93484 W 70.02139. Within miles of his ultimate destination, his eyes are on the prize: Provincetown is famous for its dark chocolate fudge.


1240. I boil water for my second pot of tea as I read yesterday's Economist on a lazy Saturday. I decline my usual afternoon foot massage, unsure of what message that will send to our little trooper.

1312. Another hour passes, devoid of contact. Fredrik concocts a scheme wherein we bribe the ferry company into denying Nat passage, forcing a return trip by bike.

1314. Weary, I send Nat an SMS, Where are you?

1345. Irresolute, Status?


1349. By the Grace of God, a message from the belly of the beast: Arrived in P-Town at 1:20. He made it!

1400. With his phone's reception poor, Nat borrows the telephone of a vacationer. His final coordinates: N 42.05229 W 70.18660. Total miles biked: 116. Boarding the ferry soon, Nat expects to be back in Boston before 1700.

And so ends the story of a man who braved physical handicap and perilous weather to bike a route all too many find too far even to drive. Today, Nat challenged our assumptions between right and wrong, up and down, east and west. While I suspect we will walk away from this tumultuous ordeal with the impetus to inspire the uninspired, ideally the real impact of Nat's munificent pilgrimage is unique to each of us, touching our hearts in a way that only we can appreciate or even understand.

One word sums up this adventure: Courage.

Thursday, July 14, 2005

Another Legislative Success

With inotify in Linus's tree, let us take a break from the economic rants and sordid stories of Bostonian fun and look at how to use the beast.

This is going to get technical.

First step is to initialize an inotify instance and associated queue:

    int fd;

    fd = inotify_init ();
    if (fd < 0)
        perror ("inotify_init");

Second step is to watch some objects. Events are generated against registered watches (and their children). Each watch is comprised of a (path,mask) pair and represented by a watch descriptor (wd). The watch mask is a bitmask of one or more events, defined in inotify.h.

Let's add a watch for closes (but only if the file was opened for writing!) and any extended attribute changes to the file coworker_blackmail.txt:

    int wd;

    wd = inotify_add_watch (fd,
                            IN_CLOSE_WRITE | IN_ATTRIB);
    if (wd < 0)
        perror ("inotify_add_watch");

Thousands of watches can be added in a similar manner. The return value--the watch descriptor--is used to tie the event back to the initial object.

Other possible events include read, write, close (but not opened for writing), open, move, create, and delete. The inotify design is extensible, and we can add new events if needed.

For the Samba folks, inotify supports one-shot watches. If IN_ONESHOT is set on the mask during watch addition, the watch is atomically removed after the generation of the first event.

The file descriptor returned by inotify_init() is select()- and poll()-able. When ready, events may be read via read(2):

    char buf[BUF_LEN];    
    int len, i = 0;

    len = read (fd, buf, BUF_LEN);

    while (i < len) {
        struct inotify_event *event = (struct inotify_event *) &buf[i];

        printf ("wd=%d mask=%d cookie=%d len=%d\n",
                event->wd, event->mask, event->cookie, event->len);
        if (event->len)
            printf ("name=%s\n", event->name);

        i += sizeof (struct inotify_event) + event->len;

We read events in this fashion for two reasons. One, inotify allows us to slurp down all available events with a single read request. Two, the size of the structure is dynamic and based on the length of the filename, if any, and associated padding.

For every event, the flag IN_ISDIR is set in the mask if the object in question is a directory.

If the object-in-question's backing filesystem is unmounted, the event IN_UNMOUNT is sent and the watch is automatically removed. Inotify, unlike dnotify, will not pin the mount.

A watch is removed via

    int ret;

    ret = inotify_rm_watch (fd, wd);
    if (ret < 0)
        perror ("inotify_rm_watch");

The size of the queue is obtainable via ioctl(2):

    unsigned int queue_len;
    int ret;

    ret = ioctl (fd, FIONREAD, &queue_len);
    if (ret < 0)
        perror ("ioctl");
        printf ("%d bytes pending in queue\n", queue_len);

The inotify instance is destroyed and cleaned up on close(2):

    int ret;

    ret = close (fd);
    if (ret < 0)
        perror ("close");

Inotify is configurable via sysctl(8) and procfs:

/proc/sys/filesystem/inotify/max_queued_events is the maximum number of events that can be queued at once. If the queue reaches this size, new events are dropped, but the IN_Q_OVERFLOW event is always sent. With a significantly large queue, overflows are rare even if watching many objects, despite what Nat might say.

/proc/sys/filesystem/inotify/max_user_instances is the maximum number of inotify instances that a given user can instantiate.

/proc/sys/filesystem/inotify/max_user_watches is the maximum number of watches per instance.

These knobs exist because kernel memory is a precious resource. Only the system administrator can change them.

Inotify is easy-to-use yet versatile; powerful yet lightweight. I am interested in seeing what applications can do with it. Already, we have Beagle, Gamin, Muine, and--hopefully soon--Samba. What's Next?

SUSE 9.3 users can grab a kernel package with inotify locked and loaded. And both Fedora and our development kernel now come with inotify! Rough riders can grab 2.6.13-rc3-git1.

Pleased to see that Dave Miller has a blog. But you need an RSS feed, duder!

Wednesday, July 13, 2005

Thursday, July 7, 2005

This Weather

Got NetworkManager's VPN support rollin' on SUSE:

NetworkManager's VPN Support (thumbnail)

Joey, forget CNN and get with the Post. The Washington Post is to CNN as gold is to feces. It is our nation's greatest paper.

Wednesday, July 6, 2005


Our Scopes Trial script--which Nat placed under a CC license--is linked off of their front page!

We are debating what to reenact next. McCarthy hearings? Trial of Socrates?


Nadav Rotem, inspired by my GUADEC talk on GNOME optimization, released Rapido, a visual profiler for Linux.

Tuesday, July 5, 2005

Scopes BBQ

We did a Scopes Monkey Trial Reenactment / BBQ for the Fourth. Nat provides a good description and the script.

Joe Prepping

Nat spent hours distilling the eight day trial into a 25 page script that would hold our mildly inebriated audience's attention.

Joe with the Vapors

I played John T. Scopes, but Joey, as William Jennings Bryan, totally stole the show.


Interestingly, Scopes' counsel included Clarence Darrow, who had represented Leopold and Loeb.


As with last year, the BBQ included corn.


Also, this view sucks.

Friday, July 1, 2005

I Ate Better Food the Two Weeks I Spent in Prison

We released gnome-volume-manager 1.3.2, rife with fejj's iPod support and other tasty treats.

David's recent hal support for gnome-vfs is sweet.

No surprise, the Fed raised the short-term interest rate to three and a quarter.

Who's next?