KIT – The cooperation of Forschungszentrum Karlsruhe GmbH and Universität Karlsruhe (TH) SYSTEM ARCHITECTURE GROUP, KARLSRUHE UNIVERSITY A Microkernel API for Fine-grained Decomposition Sebastian Reichelt, Jan Stoess, Frank Bellosa
Component model Interfaces Microkernel OS Decomposition Sebastian Reichelt, Jan Stoess, Frank Bellosa A Microkernel API for Fine-grained Decomposition 2/11 Kernel Packets MicrokernelMicrokernel Threads Address spaces IPC Threads Address spaces IPC TCP/IP stack Device driver Threads IPC Address spaces Data location? Data transfer? Split state? System knowledge? Data location? Data transfer? Split state? System knowledge? Ease of development? Reuse? Granularity? Ease of development? Reuse? Granularity?
Microkernel Our Approach Sebastian Reichelt, Jan Stoess, Frank Bellosa A Microkernel API for Fine-grained Decomposition 3/11 Packets MicrokernelMicrokernel Component model TCP/IP stack Device driver Interfaces Function calls Servers Local objects Function calls Local objects References Servers References Component model Data location? Data transfer? Split state? System knowledge? Data location? Data transfer? Split state? System knowledge?
Designing for Decomposition Sebastian Reichelt, Jan Stoess, Frank Bellosa A Microkernel API for Fine-grained Decomposition 4/11 Server Existing microkernels: Microkernel Threads Address spaces IPC Create thread Send IPC Receive IPC Task Server Our microkernel: Component model Servers Local objects References Provided interface Required interfaces Threading options Component
Reference Management Sebastian Reichelt, Jan Stoess, Frank Bellosa A Microkernel API for Fine-grained Decomposition 5/11 Microkernel
Reference Management Sebastian Reichelt, Jan Stoess, Frank Bellosa A Microkernel API for Fine-grained Decomposition 6/11 open connection TCP/IP stack TCP connection send packet Client Microkernel
Prototype Multi-server OS (~4 man-months) Basic servers (memory, scheduling,...) Drivers (standard PC hardware, PCI, Ethernet) Decomposed TCP/IP stack Linux ABI implementation (partial) Kernel (~2 man-months) IA-32 implementation Servers in kernel mode Sebastian Reichelt, Jan Stoess, Frank Bellosa A Microkernel API for Fine-grained Decomposition 7/11 Linux lwIP Evaluation: granularity, reuse, performance
Granularity Sebastian Reichelt, Jan Stoess, Frank Bellosa A Microkernel API for Fine-grained Decomposition 8/11 MinimumMaximumAverage Lines of code Bytes Linux ABI layer As fine-granular as desired Size of a server:
Reuse Sebastian Reichelt, Jan Stoess, Frank Bellosa A Microkernel API for Fine-grained Decomposition 9/11 RTL-8139 driver ported from Linux (~1 man-month): lines of code e.g. calls via interfaces instead of directly queue-based packet processing Reuse possible with little effort
Performance Sebastian Reichelt, Jan Stoess, Frank Bellosa A Microkernel API for Fine-grained Decomposition 10/11 OperationPentium 4Core 2 Cross-component call/return (kernel mode) 4623 Function call/return119 cycles OperationPentium 4Core 2 Cross-component call/return (inter-AS) L4Ka round-trip IPC Low performance overhead
Conclusion Microkernel APIs enforce system structure Existing APIs distributed systems Development, reuse, and granularity problems Our approach: component model as API More general abstractions related to decomposition (servers, interfaces, calls, references, local objects,...) Derived microkernel design Networking-capable prototype OS Good granularity and reuse, promising performance Sebastian Reichelt, Jan Stoess, Frank Bellosa A Microkernel API for Fine-grained Decomposition 11/11 Demo today
Example Sebastian Reichelt, Jan Stoess, Frank Bellosa A Microkernel API for Fine-grained Decomposition File VFS::getFile(const char *name, Size nameSize) { for (unsigned int i = 0; i < fsCount; i++) { if (fs[i].matches(name, nameSize)) { return fs[i].ref->getFile(name + fs[i].nameSize, nameSize - fs[i].nameSize); } THROW(EFileNotFound); } File VFS::getFile(const char *name, Size nameSize) { for (unsigned int i = 0; i < fsCount; i++) { if (fs[i].matches(name, nameSize)) { return fs[i].ref->getFile(name + fs[i].nameSize, nameSize - fs[i].nameSize); } THROW(EFileNotFound); } automatic reference counting automatic locking/unlocking