Live data from Hacker News

The Jury Is In: Monolithic OS Design Is Flawed [pdf]

ts.data61.csiro.au

71–80 of 199 posts

Re: The Jury Is In: Monolithic OS Design Is Flawed [pdf]

#72
post #42

Earlier quoted context omitted.

"Fast enough design" does not equal "faster design".

Particularly if you're doing kernel bypass for performance reasons, the smaller cache footprint of a microkernel is an advantage. When I was in college, the first assignment was to run a provided benchmark program that jumped all over a gradually growing buffer and graphed average latency vs. buffer size and we had to identify the sizes of thle various caches from the generated graphs. I was tripple-booting Linux Win…

Cache footprint of the OS shouldn't matter because the system should be otherwise idle and benchmark shouldn't be interacting much with the OS. The OS mostly doesn't run during the benchmark.

Assuming you didn't have those mistakes, the difference was likely due to memory allocator choices. Scattering the pages of memory is very different from laying them all out one after another. Scattered pages will cause benchmark results to be less predictable, with evictions seeming to happen at random. QNX probably made one great big allocation, in both the virtual and physical address spaces.

Re: The Jury Is In: Monolithic OS Design Is Flawed [pdf]

#73
post #27

Earlier quoted context omitted.

It's better to have buggy, incomplete drivers than no drivers at all.

This is your opinion. I prefer using hardware with stable drivers, working reliably.

That's not what I said. Would you rather have no hardware or hardware that BSODs once a month?

Re: The Jury Is In: Monolithic OS Design Is Flawed [pdf]

#74
post #56
post #19

Earlier quoted context omitted.

the Hurd-verse lives! Richard Stallman is a clean-shaven, foulmouthed autocrat, and Linus is composing folk songs about joining hands with Intel and Nvidia!

I think you mean Gnu/Linus

Or, as I've recently taken to calling him, GNU plus Linus.

Re: The Jury Is In: Monolithic OS Design Is Flawed [pdf]

#75
post #53

I'd hazard to say that every design is "flawed" in some regards: there's no way to achieve all desirable qualities and none of undesirable qualities. For one, some desirable qualities contradict each other. So "${thing} is flawed" is not precise enough; an interesting statement would be "${thing} is not the best choice for ${conditions}". A monolithic OS is not the best choice for a high-reliability system on unrelia…

The main point remains: server and desktop OS kernels are a critical piece of infrastructure, worthy of full machine checked verification.

In this context, it should be pretty obvious that a design that fails to minimise the trusted computing base is flawed. Even if a kernel vulnerability is unlikely to kill any given user, the sum of all the crashes, hacks, patching effort… is huge.

I bet my hat rewriting the entire kernel for all popular OSes would be far cheaper worldwide than not doing it. (Of course, this won't happen any time soon, because path dependence and network effects. Unless maybe someone works seriously on the 30 million lines problem described by Casey Muratory.)

> In other words, the ancient concept of "right tool for the job" still applies.

Absolutely. Monolithic kernels are clearly the wrong tool for the job.

Re: The Jury Is In: Monolithic OS Design Is Flawed [pdf]

#76
post #53

I'd hazard to say that every design is "flawed" in some regards: there's no way to achieve all desirable qualities and none of undesirable qualities. For one, some desirable qualities contradict each other. So "${thing} is flawed" is not precise enough; an interesting statement would be "${thing} is not the best choice for ${conditions}". A monolithic OS is not the best choice for a high-reliability system on unrelia…

> For one, some desirable qualities contradict each other.

Such as?

Re: The Jury Is In: Monolithic OS Design Is Flawed [pdf]

#78
post #46

Earlier quoted context omitted.

It's not a myth. Real time doesn't mean fast, it just means deterministic. And I'll throw out there that many times the the term microkernel in a lot of embedded OSs has been contorted by marketing speak into something unrecognizable. Basically if you have multiple threads in the kernel, structure the kernel code into modules (but perhaps don't even allow dynamic loading of modules), and can communicate through async…

vezzy-fnord had a lot to say on that subject. * https://blog.darknedgy.net/technology/2016/01/01/0/ ( https://news.ycombinator.com/item?id=10824382 ) * https://news.ycombinator.com/item?id=10301375

Wow, that's a gish gallop if I've every seen one.

But hey, it's lunch and why not.

1) Microkernels are defined by their small size

> In summary, the microkernel provides mechanisms corresponding to hardware features. It doesn’t provide services, just fundamental mechanisms. In particular, it does not duplicate OS services. This misunderstanding was one of the causes for the failure of first-generation microkernels. The OS community understands this.

I'd argue that exokernels fit this model much more effectively. I love XOK's kernel level support for what we'd now call DPDK with BPF (they had user space multiplexed packet queues with an in kernel vm doing filtering). And it's capability based file system cache was an amazing way to address something that no microkernel has tried to, and I've never seen anyone try to replicate anything like that yet. In fact exokernels became so good at multiplexing hardware that Xen came out of the exokernel research.

2) Microkernels are unperformant

He does what most microkernel fans do, which is regurgitate a bunch of papers from the early 90s about how if you use a 486 or early RISC (where trapping to kernel space is only as costly as a branch mispredict) then it's not that expensive. Well guess what, it's not 1992 anymore, trapping to kernel space is on the order of 1000 cycles these days instead of 5, and even outside of microkernels, that bridge has gotten so expensive that you see people not even using the kernel anymore, but instead running drivers inside the user process (see DPDK).

And yes there's a lot of hand waving about FUSE, but nobody claims that FUSE is performant solution just that the slow model that can't crash the kernel is useful in a lot fo cases.

The QNX stuff is a little disingenuous as it's essentially marketing documentation. Yes, if you push everything through a pipe on unix, you won't get the best speed. Let's compare QNX to the Unices performant solutions (ie. mmap and shared memory). Yes they made some microbenchmarks faster, but most of that is viewed as control plane rather than data plane stuff on Unix.

I'll extend a peace offering here and say that a lot of the microkernel is unperformant was a reflection of gen 1 and 2 ukernels like mach that had to do a permission check on every port access. More modern system (specifically thinking about the L4 variants here) have a capability based model that needs far fewer checks at runtime. However what I said about how traps into the kernel have gotten more expensive still hold true.

3) Microkernels are a diversion, because a userland server failure will be just as catastrophic as a kernel failure anyway

Monolithic kernels typically have the same layering internally that Minix calls out. It's about as easy to add layers to linux block device structures as it is on minix, including all of the checksumming, etc.

And neither linux nor minix protects you from logical bugs in filesystems screwing up anything and everything. We like to think of the kernel in a ukernel as being totally separate and pure from the FS and block device drivers, but it had to be loaded from somewhere...

IMO, the monolithic/microkernel dichotomy here is a false one. Neither really address the issue per se, we need to move to type safe machine checkable languages. A recent example of microkernels screwing this stuff up was the original exploit chain that opened the nintendo switch.

4) Microkernels turn well understood memory-protection problems into poorly understood communication problems

He just spends the whole time here handwaving away how difficult distributed systems are because the internet works a lot of the time. Huge red flag for me.

5) Microkernels are a bourgeois plot to undermine free software

I used to write off what he's arguing against here, but I'm really coming around to the idea. Google's Zircon in Fuschia seems specifically designed to remove GPLv2 requirements from systems like ChromeOS and Android. Seems like a net loss for software freedom.

6) Hah, those stupid fucks are running Linux on top of their microkernel! What happened to microkernels being so great, fags?

(Ignoring the slur for the purposes of this discussion) he has a decent argument here, but I'd like to see the argument compared to containers where spinning up new OS spaces is even cheaper than a whole VM for a personality. I think a blend of the techniques a la the NtPicoProcess stuff that makes WSL here is going to be the winner here more than current ukernel design where that code runs in a different address space.

7) If microkernels are so great, why is nobody using them?

This is where he hits that disingenuousness I bring up in my parent post.

TRON isn't a microkernel, hell it doesn't even require an MMU.

OKL4 loves bringing up how basebands they're running on, but how many codebases is that?

Same with MINIX.

Done for now, haver to get back to work

Re: The Jury Is In: Monolithic OS Design Is Flawed [pdf]

#80
post #70

There is a reason why kernel code run in privileged mode, speed! If you run more kernel code in privileged mode then you do not need to copy as much data between the kernel and user space. Vs a micro kernel you will have to copy more data up to user space. Copying data to user space causes context switches and gives less performance. Larger mono kernels: Speed Micro kernels have advantages such as: smaller privileged…

Do you really need to do a full copy? What if you had a shared page and notified the user process when the data in the page was available at a certain offset.

Take a look at this paper (FlexSC: Flexible System Call Scheduling with Exception-Less System Calls):

https://www.usenix.org/legacy/event/osdi10/tech/full_papers/...

Post reply on HN