Live data from Hacker News

Two Objects Not Namespaced by the Linux Kernel (2017)

blog.jessfraz.com

11–20 of 59 posts

Re: Two Objects Not Namespaced by the Linux Kernel (2017)

#11

Why is this the case? No one has bothered to do it? It would break backwards compatibility? Linus thinks it's a bad idea?

Probably merely because it's hard to do and no one has sufficient motivation. I can think of one good use case -- y2k style problems. Also sometimes apps are tied to external events like legislation. It would be good to set the time forward for testing. You can sort of do this with LD_PRELOAD but it can get hairy. Also see @wmf's comment above.

If there is one thing Y2K taught us, its to ignore any worry about the 2038 problem until 2036, then make a HUGE deal out of it.

https://en.wikipedia.org/wiki/Year_2038_problem

Re: Two Objects Not Namespaced by the Linux Kernel (2017)

#12
> The current set of namespaces in the kernel are: mount, pid, uts, ipc, net, user, and cgroup. [...] [Time is] not namespaced. [...] The kernel keyring is another item not namespaced.

I've always argued that "everything is a file" is an exaggeration. These moments make the extent of that exaggeration clear.

If everything truly was a file, the only thing you would need to namespace is the filesystem. But in reality there are a lot of other kernel objects that are not files at all.

Re: Two Objects Not Namespaced by the Linux Kernel (2017)

#13
post #10
post #7

I wonder whether namespacing time would also result in those namespaces being able to have separate "clocks" (time backends? time schedulers?) that progress at different rates, or for different reasons. Being able to put a process into a time namespace with a deterministic "clock" would obviate a large benefit of http://www.zerovm.org/ . Also, having "clock slew" be a matter of perspective—with processes that can han…

> Also, having "clock slew" be a matter of perspective—with processes that can handle leap seconds seeing them happen instantaneously; and processes that can't handle leap-seconds, seeing slewed time—would be nice. I imagine there might be some really interesting (for meanings of interesting that include shoot me now ) and hard to track down bugs as you deal with inconsistent clocks not just across systems within a n…

IIRC Docker for Mac had a bug like this for a long time where the clocks of containers would become wildly out of date.

Re: Two Objects Not Namespaced by the Linux Kernel (2017)

#15
post #7

I wonder whether namespacing time would also result in those namespaces being able to have separate "clocks" (time backends? time schedulers?) that progress at different rates, or for different reasons. Being able to put a process into a time namespace with a deterministic "clock" would obviate a large benefit of http://www.zerovm.org/ . Also, having "clock slew" be a matter of perspective—with processes that can han…

Accelerated time might also be a way to test programs. It's similar to techniques used to test planes (by repeatedly pressurising and depressurising them). It might, for example, reveal race conditions faster in programs that ordinarily do a lot of sleeping. I wrote a bit more about this (unproven) idea here: https://rwmj.wordpress.com/2010/10/14/half-baked-ideas-accel...

Re: Two Objects Not Namespaced by the Linux Kernel (2017)

#16
post #10

Earlier quoted context omitted.

> Also, having "clock slew" be a matter of perspective—with processes that can handle leap seconds seeing them happen instantaneously; and processes that can't handle leap-seconds, seeing slewed time—would be nice. I imagine there might be some really interesting (for meanings of interesting that include shoot me now ) and hard to track down bugs as you deal with inconsistent clocks not just across systems within a n…

IIRC Docker for Mac had a bug like this for a long time where the clocks of containers would become wildly out of date.

More accurately, the clocks of the linux virtual machine running docker containers would differ from the OSX clock.

Those aren't really containers skewing from other processes on the same system as the parent describes, but of clocks skewing on two different systems (which is a totally normal thing we deal with regularly).

Re: Two Objects Not Namespaced by the Linux Kernel (2017)

#17

> The current set of namespaces in the kernel are: mount, pid, uts, ipc, net, user, and cgroup. [...] [Time is] not namespaced. [...] The kernel keyring is another item not namespaced. I've always argued that "everything is a file" is an exaggeration. These moments make the extent of that exaggeration clear. If everything truly was a file, the only thing you would need to namespace is the filesystem. But in reality t…

I agree it's unfortunate, but it doesn't really seem in conflict with "everything is a file".

Making it a file is separate from making it sensible/usable for containers. Like the /proc filesystem. They are "files", but don't many don't work as expected without something like lxcfs. Like /proc/uptime, for example.

Re: Two Objects Not Namespaced by the Linux Kernel (2017)

#18

> The current set of namespaces in the kernel are: mount, pid, uts, ipc, net, user, and cgroup. [...] [Time is] not namespaced. [...] The kernel keyring is another item not namespaced. I've always argued that "everything is a file" is an exaggeration. These moments make the extent of that exaggeration clear. If everything truly was a file, the only thing you would need to namespace is the filesystem. But in reality t…

Everything is a file hasn't been true for Unix since almost the beginning. It's kind of like the Unix philosophy of small, independent tools...except for the database where you store all the important data.

Re: Two Objects Not Namespaced by the Linux Kernel (2017)

#19
post #10
post #7

I wonder whether namespacing time would also result in those namespaces being able to have separate "clocks" (time backends? time schedulers?) that progress at different rates, or for different reasons. Being able to put a process into a time namespace with a deterministic "clock" would obviate a large benefit of http://www.zerovm.org/ . Also, having "clock slew" be a matter of perspective—with processes that can han…

> Also, having "clock slew" be a matter of perspective—with processes that can handle leap seconds seeing them happen instantaneously; and processes that can't handle leap-seconds, seeing slewed time—would be nice. I imagine there might be some really interesting (for meanings of interesting that include shoot me now ) and hard to track down bugs as you deal with inconsistent clocks not just across systems within a n…

> I imagine there might be some really interesting (for meanings of interesting that include shoot me now) and hard to track down bugs as you deal with inconsistent clocks not just across systems within a network, but processes within a single system.

I feel like the "safe assumption" that the other end of a given IPC channel (or even inter-thread communication channel) is on the same machine, is responsible for the vast majority of failures we see in e.g. Jepsen testing of databases.

After all, in sufficiently-large computers (i.e. HPC clusters that pretend to be one "computer"), you've got NUMA zones that are light-microseconds away from one another, where even threads of the same process can literally end up needing vector clocks to linearize events between themselves.

It probably wouldn't be too bad a thing if things like the Linux base-system used only internal IPC mechanisms that exposed this unreliability (like e.g. Erlang does with "unreliable async message passing" as its IPC primitive), forcing each component to deal with the fact that its peers may or may not be netsplit away from it.

Even if that scenario will only come up if you're writing code to get your GPS position from a Dyson sphere of 10-mile-deep Matryoska brains.

Re: Two Objects Not Namespaced by the Linux Kernel (2017)

#20

> The current set of namespaces in the kernel are: mount, pid, uts, ipc, net, user, and cgroup. [...] [Time is] not namespaced. [...] The kernel keyring is another item not namespaced. I've always argued that "everything is a file" is an exaggeration. These moments make the extent of that exaggeration clear. If everything truly was a file, the only thing you would need to namespace is the filesystem. But in reality t…

You are 100% correct. “Everything is a file” was more of an early design insight, which was gradually abandoned as new features were added.

There is a movement of “Unix purists” who lament this deviation from founding principles, and advocate for a return to them. The most notable example is Plan 9.

In Plan 9, everything actually is a file. And exactly as you said, all resources are namespaced via the filesystem. It’s quite elegant and practical.

Sadly Plan 9 has remained a fringe OS, and although it influenced mainstream operating system design in many ways (including the concept of /proc), I wish that influence had been stronger.

Post reply on HN