On 6/22/19, Larry McVoy <lm(a)mcvoy.com> wrote:
I've read the Mach source. Not a fan. If you
look around you can find
SunOS 4.x sources, not legal but it is out there.
If you read the SunOS vm code enough, it will come into focus for you.
The code matches what you think a VM system should be.
If you read the Mach code, nope, it's a tangled mess, there is no
clear picture there.
I read the papers and wanted to believe it was good, it is not.
I've never actually read Mach's sources, but it doesn't surprise me
that Mach's implementation is every bit as much of a train wreck as
its design. Mach and the other kernels influenced by it basically
destroyed the reputation of microkernels, even though there were
microkernels that performed comparably to or better than monolithic
kernels that actually predated Mach et al. There was one paper from
1992 [1] in which an early version of QNX 4 significantly outperformed
System V in just about every category benchmarked (one of these days I
should try to benchmark a newer version of QNX against Linux and see
if the results still hold up). I wonder, had QNX or something like it
had been the "next big thing" in the late 80s and early 90s rather
than Mach, if microkernels wouldn't have become the dominant OS
architecture, or at least a credible alternative.
I also wonder if a modern highly optimized microkernel OS could still
outperform monolithic kernels. Current open-source microkernel OSes
seem to focus on academic purism rather than real-world performance
(one of the biggest issues is that they tend to split subsystems up
vertically with little benefit to security or stability, and probably
adding significant overhead to system calls; e.g. on noux under
Genode, a simple read() of a disk file, which is a single kernel call
on a monolithic kernel and usually two context switches on QNX, takes
at least 8 context switches - client->VFS->disk FS->partition
driver->disk driver and back again).
I may find out once I get UX/RT [2] (the QNX/Plan 9-like seL4-based OS
I'm writing) working, since it will focus on real-world performance
over academic purism (I'm an architectural purist in many ways, but I
think purism must further performance and usability, not hinder them),
although I don't necessarily expect early versions to have the best
performance because the implementation will probably be suboptimal in
places. I'm still a ways from getting it working though.
[1]
https://cseweb.ucsd.edu/~voelker/cse221/papers/qnx-paper92.pdf
[2]
https://gitlab.com/uxrt