Monday, February 07, 2011

Standing Desk

Since building standing desks seem to be all the rage, I decided to put one together for work. I used an Ikea Fredrik as the base, but only used the two shelf pieces and discarded the main desk piece as I wanted it to fit in a corner. The Fredrik has multiple slots along the side allowing you to position the shelves wherever you'd like. One thing I would caution is decide once where you want the stuff as pulling it apart and reassembling is a bit of a chore and you have to built it from the bottom up. It's got quite a nice solution for cable routing and hiding power strips. I also used the Fredrik Accessory Pack mostly so I could add cup holders to the desk, but the hooks came in quite handy for wire routing and for hanging my backpack. The official instructions actually have variations which seem appropriate for standing desks. One thing I did notice with the way mine is configured is it a bit shaky if I type too hard. The vibration isn't pronounced, but its enough to slightly shake the LCD on my laptop.

I attached a 3M keyboard tray to the top shelf, but had to use some nylon spacers to attach it since there is a metal support beam running down the center of the shelf. I used two cheap LCD arms for the extra monitors -- although these tend to tilt slightly with the way I have them mounted. They also need some wood blocks added under the shelf so they have the right thickness to attach to. To top it off, I bought a cheap drafting chair for days when I feel a bit tired of standing -- but I went for one that looked uncomfortable so that I wouldn't be tempted to sit all that often.

I've been using it for a couple of weeks now and seem to be able to stand most of the day while being productive.





Posted by Picasa

Tuesday, February 01, 2011

Tuesday, October 05, 2010

Multi-pipes

Here's our poster we presented at OSDI last night on multi-pipes. Will be giving a short talk on them at IWP9 which you should be able to view next week here.

Friday, August 27, 2010

4P: a four-protocol API for synthetic filesystems

I've been implementing a lot of synthetic filesystems lately, and it struck me that (at least in the Plan 9 world, but it also seems to hold true for many Linux synthetic file systems) there is a lot of boilerplate gunk in synthetic file systems which is largely unnecessary -- particularly for control interface synthetic file systems (as opposed to normal disk access file systems or some sort of data-exchange file system). For this I'm talking more about interfaces like /proc.

In any case, it seems to me what things largely boil down two is two basic operations, get and put, with perhaps two other protocol elements for flushing and outstanding request and reporting errors. By and large this is the same conclusion that the Octopus protocol [1] folks came to (although they have more complexity and operations than I think are necessary), and its also the fundamental observation underlying web-style RESTful transactions.

The advantage of a minimal interface for synthetic control file systems is that it should allow you to keep the server implementation extremely simple and it will minimize the over-the-wire transactions necessary to complete a given operation (which for many control interfaces is even more critical due to the synchronous nature of walk, open, read, close or walk, open, write, close operations -- particularly for large latency network links). This last point was, I believe the primary motivation for the Octopus folks.

So, punting on security for the moment, the basic principle is to have the 4 protocol operations (Get, Put, Flush, Error -- hence 4P). They follow the same basic protocol convention of 9P with a basic header of size[4] op[1] tag[2]. We ditch fids and the state associated with them for just sending the full path on every operation -- the basic observation being that in most synthetic control file systems we tend to open, read/write, and then close the file -- so there is no reason to have the file held open, and path resolution is simple enough to obviate the need for fid processing/tracking. The basic operations are similarly simplified:

size[4] TPut tag[2] flag[s] path[s] meta[s] data[s]
size[4] RPut tag[2]

Put ends up assuming the job of creation as well as writing data. RESTful semantics are assumed, so individual operations are treated as atomic and whole-file operations -- there is no partial update in the protocol, so no offsets. meta[s] is actually a subset of the typical stat style meta-data, as control systems typically only have user, group, and perm style metadata. flag[s] allows some extended operations and semantic features allow exclusive creation (don't create if it's already there), blocking (to wait for it to not be there before putting data we have), append operation (add to the end instead of just replacing), as well as specification of meta-data only put operations (which might change owner but not data for instance). Using a string for the flags allows file-specific flags (which might lead to nightmares, but I'm leaving it in for now), and partial support of flags is of course allowed (returning an error on an unsupported flag).

size[4] TGet tag[2] flag[s] path[s] nmsg[4] count[4]
size[4] RGet tag[2] meta[s] data[s] more[1]

Get has a similar simplified nature, although it does allow specification of partial reads (although always from the top of the
file) by using count[4]. Since gets can also be streaming (multiple reply messages, get allows you to specify the maximum
number of reply messages you wish to receive relating to this transaction) - the response more field lets the client know when there are more packets coming related to this transaction on the same tag. Get also accommodates flags allowing the specification of advanced functionality including removing the file after getting (linda style), truncating the file after getting, waiting for an update to be put into the file before processing a get (server relative time), only retrieving data, only retrieving metadata, and specification of streaming (allow up to nmesg[4] return messages on updates to the file).

From a client perspective we could build these as either a 9P gateway or a VFS file system (as well as building a client library for tighter binding with an application or application(s)). From a server perspective, we could build servers in a similar fashion to the golang http servers, allowing handlers to be registered for elements, using regular expressions for allowing parameters to be encoded into paths. To enhance modular construction, we could allow for hierarchical representation of the handler tables which should also make search more efficient.

Using such a system it would be possible to construct a hello world file server in a few lines of code, with more complicated dynamic control file systems able to be constructed with not too much additional effort since the system takes care of managing the path hierarchy for you. Its not intended for such a system to be used for typical storage file systems or anyplace where large amounts of data need to be processed or accessed with varying degrees of granularity -- but for command/control file systems this should provide a more optimal solution both in terms of time to develop as well as network latency and efficiency.

A big motivation here as well as this takes some of the state out of the 9P protocol, which might allow more complicated distributed dynamic command/control frameworks. I imagine this might be particularly useful for xcpu style distributed execution environments -- which is where we intend to play with the approach.

[1] Octopus Protocol: http://lsub.org/ls/export/op.pdf

Wednesday, January 27, 2010

Linux 9P Trace and Walkthrough



Unfortunately video didn't come out.

9P Overview Slides



MP4 Video Link or Livestream below:

Watch live streaming video from graverobbers at livestream.com

Tuesday, October 06, 2009

Grande

As a quick experiment the other day, I wrote a file-system back-end for Venti which serves the Venti protocol, but instead of using Indexes/Arenas/etc. for the back-end, it creates a hierarchical directory structure similar to Git with a file per score. This was done in the context of some other experiments (which I will post about later when they are complete), but I figured this may useful in of itself. The code is currently available in my vdiskfs branch of Plan 9 Ports on bitbucket (http://bitbucket.org/ericvh/vdiskfs/src/tip/src/cmd/venti/grande.c). It is very much a prototype, so not very robust -- but feel free to use it or build on it if you think it is useful to you.

Tuesday, August 04, 2009

acme-js

I wonder how hard it would be to craft a web 2.0 ACME -- the basic widget sets are all there more or less, the new portal examples from the prototype JS libraries would be most of the work, just need handles to allow stretching the portals and a bit more interactivity in the title bars. Chording may be a bit of an issue, but according to the W3C spec I should be able to detect events for all three buttons.

Of course, there is more to it than just the interface. The back-end would be a file system providing both the traditional ACME synthetic file server and a separate directory (or perhaps view) with the necessary UI components (as JS and whatever). I was thinking a third view might be necessary for interaction with other users, but perhaps that could all be managed from the system view.

Thursday, July 16, 2009

stats

For profiling and regression tests it would be nice to log snapshots of certain system performance counters (/dev/sysstat, /dev/swap, etc.) before and after the kernel of the benchmark (which may not be the entire application). It would also be nice to be able to enable periodic logging (although that would interfere with many benchmarks -- particularly OS noise). Periodic logging interference could be mitigated by placing the log process on a different core than the application kernel core (when possible).

I think the general idea would be to have a file in the namespace which can be written to to either snapshot the stats or start periodic logging on a particular core. The file could then be read to get the snapshot data in some convienient format. If this was all done on a single open that may even allow for several simultaneous users -- although the specific scenario that we are using probably wouldn't require that.

Wednesday, July 08, 2009

Tree and Torus Woes

Some of my modifications to cpu (specifically chdiring after backmounting the initiator to allow for a poor-man's desktop extension model) seems to have tickled a big bug on the CPU nodes -- namely the torus starts getting errors even though the torus isn't being used (by anything). Could be a sign of major memory corruption, but I doubt the cpu application itself could be the cause. More likely the backmount which becomes the CWD of the compute node starts issuing lots of 9P requests over the tree and things fall down. Of course it could just be a slightly different binary tickling the system in a slightly different way and producing a corner-case error condition that scrambles memory. At least it seems to be reproducable.

CPU, Desktop Extensions, and Caches

Okay - having the default be mounting our home directory seems to be a really bad idea. ftq- which writes one line at a time takes f-o-r-e-v-e-r to complete just writing out the data. We need a custom cfs that does aggressive cache and also does some write-back caching as well for this to even remotely work.

Of course that will fly in the face of doing this from all cpu nodes to a single file.

This turns out to be a nice driver, doesn't it? So what we want is a single cache running on the IO node and the cpu nodes mounting that. That could be a matter of switching to the chaining cpu method (of course that would require more modifications to cpu.c).

The other thing I've been toying with is the idea of being able to pass a setup script or namespace script to cpu in the same manner than xcpu allows. This would allow us to establish a default namespace, including mounting relevant file servers and/or setting up cache servers.

The other side of this is that this work will all be completely obviated once we have the execution model in place -- but it is useful to have this naive approach as a point of comparison to justify the execution model.

Monday, June 29, 2009

HARE FastOS Workshop Talk Video Available

The video podcast of my talk on HARE for the FastOS June 2009 Workshop is now available for download or from iTunes. Slides are available separately here.

Thursday, June 25, 2009

On regressions and progress

Initial take will just use the single threaded ftq for regression, we still need a regression script to organize results, but this should be relatively straightforward since all the version info is availabel in the #P device. Not clear how we get md5sum of the binary unfortunately, we can make certain assumptions based on surveyor. To keep things simple, we'll start with hardcoded version and then generalize.

bugs in lat_ctx may be timing related, potentially complicated by the virtual machine. Need to get criswell rebooted and try out there to make sure its not something stupid tripping things up. Be good to have ftq and 9bench numbers for a typical x86 machine to calibrate against anyways.

Nope FP errors happen on criswell as well, something is buggered in the timing code when the measurements are too small.

Okay, not a whole lot of progress today. Futz'd a bit with the lmbench code to see what works and what doesn't. It will be a nice set of numbers at the end of the day and we have the x86 code to compare against.

Since criswell is running the same hardware as the box next to it I should be able to get numbers for Plan 9 vesus Linux easily enough and we can use these as baselines for the normal Plan 9 regressions. We'll need to get the kittyhawk and/or zeptos code base running and try either lmbench or our modified versions there.

Of course, the thing I was suppose to be doing today was getting a top-level script together which runs on the desktop and initiates data collection (initially only of ftq) and stores results in a hierarchy based on kernel configuration (as read by '#P'/version and md5sum 9bgp.elf). I suppose I may still be able to pull those basics together this evening.

Monday, June 22, 2009

Regressions

Its become clear in the process of the HARE work that we really need a regular regression suite to verify functionality as well as track performance over the course of development. It strikes me that whatever we come up with may be generally useful for the Plan 9 kernel since it seems we don't really have any quantitative tracking of kernel performance.

Seems like one of the first things we need is better information about the kernel encoded in the binary. We've got the date in KERNDATE of when it was build, but little information about where and when it was built (and also, by who).  This seems increasingly important in an environment where we aren't just building out of a single directory. For my purposes, some sort of tree identifier such as a venti score or a git HEAD would be useful to encode to track exactly which version of the kernel we are testing. Eventually it seems like it would be a good idea to have a unique id for the build tools and root file system as well.

Regressions will be stored in a temporal directory hierarcy (similar to yesterday), then a directory with the $OBJTYPE filled a directory labeled by the md5sum of the kernel binary at the leaf. This directory will contain an info file with extracted meta-data about the kernel and a numbered subdirectory per run collected. Each of the numbered subdirectories will contain a console output file, and a test output file per test (named by the test). There will also be an info file with any relevant information about the run (in the case of BG/P this will be the personality and bump-id).

The regression binaries will be included with the kernel as part of the initial ramdisk to make things simple at first. The script will be modular and run from the front-end node, requiring nodes be able to boot to the point where one could cpu into them.
This will also require us to be able to determine the assigned IP address of the IO Node(s) automatically. It makes sense to go for 128-node configurations with 2 IO nodes so we can test the Ethernet bandwidth between IO nodes and not just to the front end.

The idea right now is to have a set of 5 initial performance regressions covering computation, sparse memory access, OS interference, file system access, and network access using a typical 4-way SMP configuration. Eventually we may broaden these tests to cover a range of configurations including uniprocessor and large-page. The general idea is to have a short regression which runs around a minute or so for simple sanity check of the system at boot-up and have a longer regression which runs on a daily schedule and does a more comprehensive evaluation.

For the longer test one option might be to measure the time it takes to build the entire system from scratch (kernel build or kernel+applications) on every Blue Gene node hitting a single file server for source files and storing results to a ramdisk. A variation on this would be to develop a parallel build system in which all 128 nodes collaborated on compiling the system.

Another idea I am considering is the use of linuxemu to run Linux benchmarks under Plan 9 to both measure the kernel and the emulation infrastructure. Candidates would include lmbench, postmark, dbench, and netperf.

The initial focus is on gathering results, but the idea is one we have started collecting data to allow web-based visualization of the results tracked over time so we can monitor the general health and performance of the system, As use cases materialize for testing we'll add them to the matrix.

Thursday, June 18, 2009

FastOS Podcast Launched

I went through and worked out the creation of a video podcast including setting up the right iTunes syndication. I'll be posting all the FastOS talks (including the HARE/Plan 9 one) eventually. They (and the slides) are available on the FastOS site (http://www.fastos2.org) and via iTunes

Its fairly easy, assuming you have a good mic for the speakers. I may try to go and clean up the old IWP9 talks we have video of, but as a community it would really be a good idea to start making video podcasts of talks, tutorials, and whatnot. All the kids are doing it these days after all. I'm thinking of going back and capturing all of my past talks that I still have the slides for.

Plan 4?

Perhaps instead of changing names or increasing numbers with Plan 9, we should reduce numbers in subsequent versions since we strive to have less code and complexity (unlike certain other operating systems).

Of course, there is the problem that all the other Plans did fail to enslave humanity. Still, there would be something nice to a Plan 4 which was more compact and simple, and it could use a reduced operating protocol 4P for communication. Of course, counting down from 9, we have a short window of opportunity to succeed.

Thursday, May 28, 2009

Inferno ACME BG/P Environment

Have everything setup now to be able to launch and mount a remote inferno and then interact with the host using its devcmd and file system (and its network).

This lets me deal with BG/P (and cobalt and telneting to the nodes) completely inside ACME -- except the Inferno telnet (inside ACME anyways) is spewing CRs and not echoing my input.  Blech.

ACME Trivia

So Feedkey allows me to setup ACME to prompt for Factotum challenges -- but how do I get Feedkey to start every time I start ACME?  It doesn't show up in the dump, so its not as clear as autostarting other aspects of the system.

Wednesday, May 27, 2009

export over ssh stdio

So, I've modified the lcmd stuff a bit and am able to mount a remote inferno instance that I start with an os ssh:

(local script)
#!/dis/sh

load std expr string
args := $*
s := sh -c ${quote $"args}
mkdir -p /tmp/lpipe
bind '#|' /tmp/lpipe
echo os
os ssh $remote /home/ericvh/inferno/Linux/power/bin/emu -I -r /home/ericvh/inferno /dis/sshexport /tmp/lpipe/data1 &
echo shell
mount -A /tmp/lpipe/data /n/remote
/dis/sh
echo halt > /n/remote/dev/sysctl
unmount /n/remote
(remote script)
#!/dis/sh
load std
or {ftest -e /net/cs} {ndb/cs}
bind -c '#U*' /n/local
bind -a '#C' /
bind '#|' /tmp/pipes
cat /tmp/pipes/data > /dev/hoststdout&
cat /dev/hoststdin > /tmp/pipes/data&
export / <>/tmp/pipes/data1 >[2] /dev/null
echo halt > /dev/sysctl



The problem is that if I terminate the local inferno, the remote emu still runs. &nbsp;I'm not sure how to catch and clean that up gracefully....