Hacker News new | ask | show | jobs
by flag_bcz_mad 2718 days ago
What kinds of tasks are slower on a micro-kernel? Are there use-cases where a micro-kernel is just as fast as a monolithic?
2 comments

> What kinds of tasks are slower on a micro-kernel?

Crossing from usermode to kernel is slower, and generally doing complex things in kernel is much slower. (Where complex means cross-cutting concerns, so multiple different kernel processes need to be involved.)

> Are there use-cases where a micro-kernel is just as fast as a monolithic?

Anything that doesn't really involve the kernel much at all, and things that take a lot of time in kernel but do so in one part of it with no need for input from other parts.

Generally, when you go for a microkernel you need to accept that it will be slower than monolithic. It might still be worth it for the advantages of microkernels, namely being easier to verify, understand and secure.

The basic issue is that, when you make a syscall in most kernels, it needs to do permission/capability checks.

With a micro kernel, it’s more or less inevitable that you have a lot more traffic in and out of the kernel so the overhead tends to be higher.

If your application doesn’t make a lot of syscalls then you won’t have the issue so much e.g. something very compute heavy.

You mitigate the issues, on the kernel side, by making the checks as fast as possible and removing them if it’s safe. On the userspace side, you try to avoid syscalls in performance critical code. Like you would with a monolithic kernel.