The Performance of Micro-Kernel- Based Systems
- Native OS(Linux) performance on Micro-Kernel(5-10% lower)
- CO-LOCATED OS
- specialization(PIPES), extensibility(CACHE-AWARE, VM, REAL-TIME)
- 100% binary compatibility
What is a microkernel
- kernels that only provide process + address spaces(memory), threads(CPU), and IPC(communication)
- kernel does not handle e.g. the file system or interrupts
what is L4
- so called 2nd generation microkernel
- built from scratch as opposed to a developed from earlier monolithic kernel approaches (e.g. Mach)
L4 essentials
- threads, address spaces and cross-address-space communication (IPC)
- other kernel operations e.g. RPC and address-space crossing thread migration are built up from IPC primitives
Address spaces
- recursive construction
- granting, mapping, unmapping
- a page owner can grant or map any of its pages to another address space with the receiver permission. That page is then accessible to both address spaces
- only the grant, map, and unmap are implemented in the kernel
- user-level “pagers” handle page faults
Interrupts, exceptions, and traps
- all handled at user level
- interrupts are transformed, by kernel, into IPC messages and sent to appropriate user level thread
- exceptions and traps are synchronous to associated thread and kernel mirrors them to that thread
Slower than native linux
GNU/HURD就是微内核的,你如果感兴趣,可以使用kexec命令自动切换内核去尝试一下.
微内核的坏处,光性能损耗一条就够了。那么多驱动运行在非0态,每次进程调度导致 TLB 刷新,调度后运行稍微多些代码,又导致L1、L2 失效。
Tagged TLB
不需要flush, speed up. But reduce the size of effective TLB.