Operating System KernelsSummary of First PaperSummary of Second PaperMicrokernelsMonolithic and Micro-kernelsMicrokernels: ProContext SwitchesMicrokernel: ConPaper GoalsMore Paper GoalsThe L4 MicrokernelThe L4 Microkernel (continued)L4LinuxL4Linux (continued)L4Linux – System CallsA note on TLBsMicrokernel Cons RevisitedPerformance – CompatibilityPerformance – The CompetitorsPerformance – BenchmarksPerformance - MicrobenchmarksPerformance - MacrobenchmarksSlide 23Performance – AnalysisSo What?Microkernel Con: Revisited AgainFlux OSThe Flux OSKitAdapting Existing CodeSeparating OS ComponentsOSKitDiagram of OSKitExample OS using OSKitAnother Example OSOSKit ComponentsMore OSKit ComponentsEven More OSKit ComponentsTwo more OSKit ComponentsOSKit Component InterfacesOSKit ImplementationProviding SeparabilityGlue CodeWhat is this “glue code”?More “glue code”InterfacesExecution EnvironmentSlide 47Exposing the ImplementationEncapsulating Legacy CodeThe Obligatory BenchmarkBandwidth AnalysisLatencyCase Study 2: Standard MLOther language based OSsOSKit vs. MicrokernelOperating System KernelsPeter SirokmanSummary of First PaperThe Performance of µ-Kernel-Based Systems (Hartig et al. 16th SOSP, Oct 1997)Evaluates the L4 microkernel as a basis for a full operating systemPorts Linux to run on top of L4 and compares performance to native Linux and Linux running on the Mach microkernelExplores the extensibility of the L4 microkernelSummary of Second PaperThe Flux OSKit: A Substrate for Kernel and Language Research (Ford et al. 16th SOSP, 1997)Describes a set of OS components designed to be used to build custom operating systemsIncludes existing code simply using “glue code”Describes projects that have successfully used the OSKitMicrokernelsAn operating system kernel that provides minimal servicesUsually has some concept of threads or processes, address spaces, and interprocess communication (IPC)Might not have a file system, device drivers, or network stackMonolithic and Micro-kernelsMicrokernels: ProFlexibility: allows multiple choices for any service not implemented in the microkernelModular design, easier to change Stability: Smaller kernel means it is easier to debugUser level services can be restarted if they failMore memory protectionContext SwitchesMicrokernel: ConPerformanceRequires more context switchesEach “system call” must switch to the kernel and then to another user level processContext switches are expensiveState must be saved and restoredTLB is flushedPaper GoalsIs it possible to build an OS on a Microkernel that performs well?Goal is to prove that it isPort Linux to run on top of L4 (a microkernel)Compare performance of L4Linux to native LinuxSince L4Linux is a “complete” operating system, it is representative of microkernel operating systemsMore Paper GoalsIs this actually useful? Is the microkernel extensible?Implemented a second memory manager optimized for real-time applications to run alongside Linux on L4Implemented an alternative IPC for applications that used L4 directly (requires modifying the application)The L4 MicrokernelOperations:The kernel starts with one address space, which is essentially physical memoryA process can grant, map, or unmap pages of size 2n from its own virtual address spaceSome user level processes are pagers and do memory management (and possibly virtual memory) for other processes using these primitives.The L4 Microkernel (continued)Provides communication between address spaces (inter-process communication or IPC)Page faults and interrupts are forwarded by the kernel to the user process responsible for them (i.e. pagers and device drivers)On an exception, the kernel transfers control back to the thread’s own exception handlerL4LinuxLinux source has two cleanly separated partsArchitecture dependentArchitecture independentIn L4Linux Architecture dependent code is replaced by L4Architecture independent part is unchangedL4 not specifically modified to support LinuxL4Linux (continued)Linux kernel as L4 user serviceRuns as an L4 thread in a single L4 address spaceCreates L4 threads for its user processesMaps parts of its address space to user process threads (using L4 primitives)Acts as pager thread for its user threadsHas its own logical page tableMultiplexes its own single thread (to avoid having to change Linux source code)L4Linux – System CallsThe statically linked and the shared C libraries are modifiedSystem calls in the library call the kernel using L4 IPCFor unmodified native Linux applications there is a “trampoline”The application traps to the kernel as normalThe kernel bounces control to a user-level exception handlerThe handler calls the modified shared libraryA note on TLBsTranslation Lookaside Buffer (TLB) caches page table lookupsOn context switch, TLB needs to be flushed A tagged TLB tags each entry with an address space label, avoiding flushesA Pentium CPU can emulate a tagged TLB for small address spacesMicrokernel Cons RevisitedA significant portion of the performance penalty of using a microkernel comes from the added work to reload the page table into the TLB on every context switchSince L4 runs in a small address space, it runs with a simulated tagged TLBThus, the TLB is not flushed on every context switchNote that some pages will still be evicted – but not as manyPerformance – CompatibilityL4Linux is binary compatible with native Linux from the applications point of view.Performance – The CompetitorsMach 3.0 A “first generation” microkernelDeveloped at CMUOriginally had the BSD kernel inside itL4A “second generation” microkernelDesigned from scratchPerformance – BenchmarksCompared the following systemsNative LinuxL4LinuxMkLinux (in-kernel)Linux ported to run inside the Mach microkernelMkLinux (user)Linux ported to run as a user process on top of the Mach microkernelPerformance - MicrobenchmarksPerformance - MacrobenchmarksAIM Benchmark Suite VII simulates “different application loads” using “Load Mix Modeling”.Paper does not say which “Mix” was used Could not find reference for AIM Benchmark Suite VIIPerformance - MacrobenchmarksPerformance – AnalysisL4Linux is 5% - 10% slower than native for
View Full Document