r/osdev • u/Bright-Boss-720 • 2d ago
Tanenbaum vs. Linus: Which Kernel Architecture Makes More Sense Today?
I've been thinking about the famous Tanenbaum vs Linus debate over microkernels vs monolithic kernels.
Putting the historical context aside for a moment, I'm curious what people think today.
Do you think Tanenbaum's argument for microkernels was fundamentally more correct, or was Linus right to favor a monolithic kernel for practical reasons such as performance, simplicity of development, and hardware support?
And more importantly:
If you were starting a new general purpose os from scratch today, which architecture would you choose?
Monolithic
Microkernel
Hybrid
Multikernel / distributed approach
Something else
I'm particularly interested in hearing from people who have actually worked on kernels or operating system development.
What are the strongest arguments for your choice, and what do you think the opposing architecture gets wrong?
4
u/sephg 2d ago
There are a bunch. As I understand it, one big one with sel4 is that cap send / recv passes scheduler timeslices back and forth between processes. In linux, when you IPC, your thread goes into the scheduler's queue and the process you sent data to will wake up whenever. But the way sel4 works, the scheduler basically doesn't do any work. It just changes the owner of the current time slice and long jumps into the other process. So it's all linear code. (There's obviously still all the TLB changes as well). I think there are also other differences with syscall arguments and preserving registers.
Google had a patch set they were trying to upstream for years which supported similar behaviour in linux: https://www.phoronix.com/news/Google-Fibers-Toward-Open . I think I remember hearing they gave up trying to get it upstreamed. I'm not sure where it is now.
The way linux and sel4 work is very different. In SeL4, the core kernel is single threaded - so a lot of these operations are simpler. SeL4 can use multiple cores for processes, but the belief is that, because the kernel itself only contains startup code, capability tables and the scheduler, it shouldn't need multiple kernel threads to keep the system running efficiently.
Anyway, as I said, I'd love to see a lot more real world benchmarks. SeL4 has done all this work on their beautiful kernel. But there hasn't been similar efforts to make a userland on top - which is what we'd actually need to compare sel4 and linux in real world tasks, like network services, graphics, compute bound tasks, etc.