[Server-devel] [PATCH] Detect school network, fix sleep and race, fix AC

Martin Langhoff martin.langhoff at gmail.com
Tue Jun 17 10:47:43 EDT 2008


On Mon, Jun 16, 2008 at 10:11 PM, Michael Stone <michael at laptop.org> wrote:
> Argh. Martin and I just straced python -c 'import os; os._exit(0)' and
> found that it makes over 10 times any many syscalls as bash does in
> order to run 'exit 0'; perhaps or more or less depending on your
> particularly libraries. (Martin was unsurprised.)

A couple more notes here. I've been using this technique for a long
time. In most cases you have a shell around you, so exec'ing bash is
very cheap. There is a long list of ops that are very cheap to do from
bash, and that means that you can achieve fantastic savings by
front-loading cheap checks.

(Of course, there are ops that are very expensive from bash, as soon
as you are calling sed/sort pipelines, chances are you are losing your
edge. Testing for file existence, and reading tiny files with cat is
so cheap as to be free.)

We must wake up often to check if it's a good time to trigger a backup
-- short of C, I'll use any reasonable lightweight trick in the book.
And this one is well known, and full of unix goodness.

> Perhaps we could arrange to leave the bits of state that Martin wants to
> check lying around on a tmpfs somewhere so that he can check them with a
> handful of syscalls instead of a few hundred?

Yes, please. And it can then be reused by any number of tools.

> I'm very uncomfortable relying on DNS as our means of XS discovery
> because we really, really, really want to be able to acquire activation
> leases over the network from a central repository like an XS from our
> initramfs before we've run unsigned code and I can't, for the life of
> me, figure out a satisfying way to perform correct network configuration
> for everybody in the initramfs.
>
> In response to this concern, Martin basically suggested that we create a
> separate authentication channel for special use by the initramfs with a
> recognizable SSID. Polychronis replied with some ways that we could use
> Ethernet broadcasts to create a 'network buoy' to direct XOs. I'll leave
> it to the two of them to flesh out their proposals in more detail over
> the next few weeks.

And a bit later, my conclusion was: yes, associating with every ESSID,
requesting DHCP and attempting DNS resolutions of "schoolserver" there
is slow and clunky. but it's well known, trivial to implement and will
work anytime. We can optimise it a lot by simply preferring some ESSID
names (those following a pattern).

Perhaps not as graceful as other ideas we discussed, but it has the
distinct advantage of being doable in real life, with our real-life
constraints. I'll take something we can do and release - warts and all
- over any plan that involves boiling oceans. :-)

cheers,



m
-- 
 martin.langhoff at gmail.com
 martin at laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff


More information about the Server-devel mailing list