/sys/doc/ Documentation archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bind() and mount() confusion



I've read the mail thread and the whitepaper on namespaces and I think I
understand both the distinction between them and how they work.  I think
the confusion is rooted in the way that bind seems to add new namespace,
when it really doesn't.

Perhaps this is a philosophical distinction, but Inferno really has _two_
namespaces.  One is the traditional slash-rooted directory tree.  The
other is a sharp-rooted directory tree.  (If you don't think that's the
case, try navigating it: for example, "cd '#C'; ls" works just fine.)

Extensions to the slash-rooted tree are done by mounting a user-level
thread that serves some subtree.  Similarly, extensions to the sharp-
rooted tree are done by mounting a kernel-level thread that serves
the subtree; all of these threads are mounted magically by the kernel.
(I haven't tried to see if one can mount user-level threads in the
sharp-rooted tree; it'd be an interesting experiment, but it ought to
work.)

If one has this model, then it's more obvious that bind simply splices
the already-existing namespace together.

There is the difference that a bind to a sharp-rooted tree does seem to
start another kernel thread to serve the namespace so that you get a
fresh copy of the subtree.  I don't think this distinction is significant
enough to upset the overall model, however.

But it does give rise to a question that perhaps the Inferno developers
could answer:  Why two namespaces?  Things would seem to work just as
well if the kernel magically mounted all the kernel threads in their
default location.  And for those resources that justify having distinct
copies, have a name that clones a new subtree.

Hope this helps,
-- Greg Noel, Qualcomm