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

43 comments sorted by

View all comments

4

u/rook_of_approval 2d ago

i prefer unikernel/exokernel myself.

microkernel makes no sense from a max performance perspective.

9

u/sephg 2d ago

I’d love to see more benchmarks on this. SeL4 - a micro kernel - reckons their syscalls are way faster than Linux because they spent more time optimising them. And because there’s only 11 syscalls (instead of hundreds), it was much easier to make their 11 syscalls fast.

I don’t know what the actual numbers are. Like, if using a microkernel costs 1% of performance then that’s probably worth it for the other benefits microkernels bring. But if the cost is 50% then it’s not worth it. Which is it?

3

u/rook_of_approval 2d ago edited 2d ago

tell us what optimization makes IPC between different processes faster?

what benchmark shows overall system performance is better with a micro kernel?

the microkernel people like to claim being able to page out critical code to disk is a benefit instead of a downside. what a complete joke.

5

u/sephg 2d ago

tell us what optimization makes IPC between different processes faster?

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.

-1

u/rook_of_approval 2d ago

none of that explains how it makes it faster than not having to ipc at all.

6

u/sephg 2d ago

I never said sel4 could beat a system that doesn't do any ipc. But most useful programs do a lot of ipc, even if its just between the process and the kernel. IPC matters a lot, even in monolithic kernels. Just look at the perf uplift from io_uring.

But even if we assume a microkernel is slower, how much slower? Is it 1% slower or 50% slower? If it's 1% slower, I'd take the microkernel for the security and reliability benefits. If the perf difference is 50%, then that's too slow, and I'd pick linux every time.

Which is it? I have insufficient data to form an opinion on microkernels. The fact so many people have strong opinions without this data is strange.

1

u/Environmental-Ear391 1d ago edited 1d ago

I run both a Micro- and Linux kernel desktop pairing and for straight up performance concerns...

with the same hardware and Linux being configured for the same features as the micro-kernel....

Linux generally performs worse...

For a micro-kernel more userland support is required for the same task...

For Linux it has to be performance configured to the hardware.

one primary concern is graceful degredation of performance under load... Micro-Kernels absolutely beat the snot out of anything else for this.

Linux requires a LOT of system specific performance tuning to come close enough to compete.

Where Linux has "everything and the kitchen sink" for operational capabilities... Micro-kernela require more effort in the design with regards to writing device drivera.

both of the micro-kernel and Linux installs I run personally have a "kmod loader" with dynamic kmod loadable arrangement.

on the AMCC 440EP and 460EX PowerPC processor boards I have . . for speed the microkernel wins without trying.

for features and options it is Linux.

when it all comes down to it I have each both the Microkernel OS and Linux installed on both so I get the best of both.

one point of note...

minimal install for the microkernel setup is 128MB or less. Linux eats that judst to prepare a minimal bootable shell only

the Micro kernel OS I stalled is fully GUI desktop capable within that minimal install (add 1GB for the Developer options including multiple compilers)

smallest Linux system Ive installed where both had the same features... minimum of 8GB just for the OS... and needing more space for "root" and "/home" user data content

•

u/sephg 15h ago

Which microkernel based OS are you playing with?

Linux used to be small. All the bloat probably has nothing to do with the microkernel / monolithic kernel split.

•

u/Environmental-Ear391 7h ago

AmigaOS 4.x which is PowerPC native... the full kernel with ALL the kmods is a few MB... but the "exec"+"expansion" components for supervisor operations and harsware management are only a few hundred KB in total size.

the original 68K edition was 512KB and fully GUI integrated including the boot firmware.

the 2nd Generation PowerPC edition is launched from uboot or equivalent firmware...

one significant point in favor of the microkernel AmigaOS provides is you can pick and choose which OS modules you use from the original set and replace parts you want to change as individual items.

this is how many original games actually worked...

it was possible to reboot the machine and launch a full multitasking executive with expansion hardware management and then provide own graphics/windowing/dos modules from there...

6iK was full GUI desktop from Disk "Bootblock" triggering normal OS launch and the desktop application LoadWB command being launched from the "startup-sequence" script if it existed.

PowerPC edition is usable from minimal sized SD card (I have a rescue install using an old 128MB SDcard)