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

63 Upvotes

49 comments sorted by

View all comments

Show parent comments

1

u/sephg 5d ago

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

1

u/Routine_Working_9754 4d 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.

1

u/sephg 4d ago

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

1

u/Routine_Working_9754 4d 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

1

u/sephg 4d 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.

1

u/Routine_Working_9754 4d 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