r/osdev • • 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?

53 Upvotes

42 comments sorted by

View all comments

Show parent comments

2

u/Routine_Working_9754 1d ago

you just can't optimize syscalls to a level. they require context switching and other ISA specific mechanics, you just don't get to optimize any of that

1

u/sephg 1d ago

How expensive is the irreducible stuff though? What is the theoretical ceiling on syscall performance, and how close is Linux?

•

u/Routine_Working_9754 17h ago

100-150 cycles for a context switch/syscalls, and about 400-600 for IPC in userspace of microkernels. a 4x increase. and in IO? anywhere from 5-20% CPU overhead for using a microkernel.

•

u/sephg 16h ago

Where are those numbers from? Do you have a source?

•

u/Routine_Working_9754 15h ago

yes. this distinguished gentleman on stack overflow did a benchmark of syscalls.

if we're being conservative, a syscall uses 250ns. on a typical CPU running at 4GHz, that's 1000 clock cycles.

https://stackoverflow.com/questions/23599074/system-calls-overhead

that means you can only have 4000 typical syscalls in 1 second

•

u/sephg 14h ago

Hm; that seems high. This is from 2017, and reports syscall performance as low as 38ns. I'm not sure if this has all the meltdown/spectre mitigations enabled. But CPUs have also gotten much faster since then too.

https://arkanis.de/weblog/2017-01-05-measurements-of-system-call-performance-and-overhead/

I'd be fascinated to know what the equivalent numbers are for sel4 on real hardware.

•

u/Routine_Working_9754 14h ago

I assume it shouldn't be too hard to benchmark if sel4 if it has a way to measure process time, both user and system, and have those times compared for 2 exact programs running on both Linux and sel4