Merry Christmas, here’s an incredibly involved bugfix

There’s been a rare segfault present in DragonFly for quite some time.  It’s been difficult to reproduce, and the 2.12 release due some months ago was held up specifically to fix it.  Matthew Dillon was, after many days (months?) of work, able to replicate it reliably and eventually find a way around what appears to be a new AMD-specific bug.  Read his very detailed explanation of what he did to get to this point.

VFS accounting benchmarks

Francois Tigeot benchmarked his accounting work with blogbench, and posted a PDF with the results.  Dmitrij D. Czarkoff made a simpler graph, which can be used to draw the conclusion: blogbench didn’t work well for estimating the impact of VFS accounting. If you want to try accounting yourself, put vfs.accounting_enabled="1" in your /boot/loader.conf.

(The normal DragonFly mailarchive isn’t updating because it feeds from DragonFly NNTP, and that’s not updating, so I’m using Gmane for post links.)

Lazy Reading for 12/11/11

Last week was low on links, but this week is great!  I hope you have some time set aside.

  • This article “The Strange Birth and Long Life of UNIX” has a picture of a PDP-11.  I don’t know if I ever actually saw one and knew it before.  (via)
  • Also from the same place: Window Managers Bloodlines.
  • Anecdotal, but probably true. (via luxh on EFNet )
  • nginx is the new cool and unpronounceable web server these days, apparently.  Michael Lucas covers how to transition static Apache sites over to it.
  • This PDF showing slides from the recent NYCBUG presentation by Ike Levy, titled “Inappropriate Cloud Use”, is entertaining, and makes a good point.  Cloud computing is cheap on a per month basis, but since it’s a reoccurring cost, it can cost a surprisingly large amount in the long run.  (via)
  • Hey, a patch for DragonFly (and other BSD) support in Google’s leveldb.
  • Don’t Be a Free User” (via)  The last paragraph is the best.
  • An expanded grep and diff.  ‘grep’ and ‘diff’ have been present for so long, and people understand what they do, generally, that new tools get named after them just because the concept is ingrained in people’s minds.  Note that I said “generally”, as regular expressions can be difficult.  (via)
  • A lot of people don’t realize how they infringe on copyright.  This writeup describes something I’ve seen for years: people think a disclaimer that effectively says “I’m infringing but I’m doing it with the best of intentions” makes a difference.  It doesn’t.
  • So this is what that Xerox Star GUI interface looked like.  You know, the ‘first’ desktop GUI.   (via) Also, there was some advanced stuff in 1968.
  • I like this indicator light setup.  (also via luxh on EFNet #dragonflybsd)  There’s some other interesting old computer stuff at that site too.  I wish there still were computers like these.
  • While we’re talking about old things with a certain feel to them, why not Battersea Power Station?  Here’s some pictures.  (via)

Your unrelated link of the day: Since we’re talking about old things and environments, why not look at some pictures of my workplace?

Two pkgsrc work directory tips

Two tips for working with pkgsrc, derived in part from this mailing list post on users@ (follow the thread) and from my own experience.  If you put WRKOBJDIR=/usr/obj/pkgsrc into /usr/pkg/etc/mk.conf :

  1. You can clean up any leftover package building files by deleting the files in that directory and leave your pkgsrc files untouched.
  2. You can have a read-only /usr/pkgsrc, which means it can be shared over NFS (or SMB?) between multiple machines, DragonFly or otherwise.
Parallelized buildworld now possible

Buildworlds are now much faster, because they can run themselves in parallel.  Invoke it using the -j option to make.  Matthew Dillon saw a 25% reduction in time when using ‘make -j 12 buildworld’ on a 4-core system.  You may need to manually update xinstall and mkdir:

        cd /usr/src/usr.bin/xinstall
        make clean; make obj; make all install
        cd /usr/src/bin/mkdir
        make clean; make obj; make all install

It’ll also use more memory than a non-parallel build, but heck, that’s cheap these days.

An unexpected way to do strlen()

The general rule of thumb is that if you have a function written in an interpreted language (Perl, Python, etc.), it’ll be faster in C.  If you need it faster than that, you go to assembly.  Prepare to have your world rocked: Venkatesh Srinivas found that strlen() in libc was actually slower written in assembly than in C.  His commit message has numbers to back that up.