资源描述
Click to edit Master title style,Click to edit Master text styles,Second level,Third level,Fourth level,Fifth level,*,The Performance of Micro-Kernel-Based Systems,H.Haertig,M.Hohmuth,J.Liedtke,S.Schoenberg,J.Wolter,Presentation by:,Seungweon Park,Introduction,-kernels have reputation for being too slow,inflexible,C,an 2nd generation-kernel(L4)overcome limitations?,Experiment:,P,ort Linux to run on L4,(Mach 3.0),C,ompared to,native Linux,MkLinux(Linux on 1st gen Mach derived-kernel),Introduction(cont.),T,est speed of standard OS personality on top of fast-kernel:Linux implemented on L4,T,est extensibility of system:,pipe-based communication implemented directly on-kernel,mapping-related OS extensions implemented as user tasks,user-level real-time memory management implemented,T,est if L4 abstractions independent of platform,L4 Essentials,Based on threads and address spaces,R,ecursive construction of address spaces by user-level servers,I,nitial address space,0,represents physical memory,B,asic operations:granting,mapping,and unmapping.,O,wner of address space can grant or map page to another address space,A,ll address spaces maintained by user-level servers(pagers),L,4,Linux,Design&Implementation,Fully binary compliant with Linux/X86,Restricted modifications to architecture-dependent part of Linux,No Linux-specific modifications to L4 kernel,L,4,Linux,Design&Implementation,Address Spaces,Initial address space 0 represents physical memory,Basic operations:granting,mapping,and unmapping.,L4 uses“flexpages:logical memory ranging from one physical page up to a complete address space.,An invoker can only map and unmap pages that have been mapped into its own address space,L,4,Linux,Design&Implementation,L,4,Linux,Design&Implementation,Address Spaces(cont.),I/O ports are parts of address spaces.,Hardware interrupts are handled by user-level processes.The L4 kernel will send a message via IPC.,L,4,Linux,Design&Implementation,The Linux server,L4Linux will use a single-server approach.,A single Linux server will run on top of L4,multiplexing a single thread for system calls and page faults.,The Linux server maps physical memory into its address space,and acts as the pager for any user processes it creates.,The Server cannot directly access the hardware page tables,and must maintain logical pages in its own address space.,L,4,Linux,Design&Implementation,Interrupt Handling,All interrupt handlers are mapped to messages.,The Linux server contains threads that do nothing but wait for interrupt messages.,Interrupt threads have a higher priority than the main thread.,L,4,Linux,Design&Implementation,User Processes,Each different user process is implemented as a different L4 task:Has its own address space and threads.,The Linux Server is the pager for these processes.Any fault by the user-level processes is sent by RPC from the L4 kernel to the Server.,L,4,Linux,Design&Implementation,System Calls,Three system call interfaces:,A modified version of libc.so that uses L4 primitives.,A modified version of libc.a,A user-level exception handler(trampoline)calls the corresponding routine in the modified shared library.,The first two options are the fastest.The third is maintained for compatibility.,L,4,Linux,Design&Implementation,Signalling,Each user-level process has an additional thread for signal handling.,Main server thread sends a message for the signal handling thread,telling the user thread to save its state and enter Linux,L,4,Linux,Design&Implementation,Scheduling,All thread scheduling is down by the L4 kernel,The Linux servers schedule()routine is only used for multiplexing its single thread.,After each system call,if no other system call is pending,it simply resumes the user process thread and sleeps.,L,4,Linux,Design&Implementation,Tagged TLB&Small Space.,In order to reduce TLB conflicts,L4Linux has a special library to customize code and data for communicating with the Linux Server,The emulation library and signal thread are mapped close to the application,instead of default high-memory area.,Performance,What is the penalty of using L4Linux?,Compare L4Linux to native Linux,Does the performance of the underlying micro-kernel matter?,Compare L4Linux to MkLinux,Does co-location improve performance?,Compare L4Linux to an in-kernel version of MkLinux,Microbenchmarks,measured system call overhead on shortest system call“getpid(),Microbenchmarks(cont.),Measures specific system calls to determine basic performance.,Macrobenchmarks,measured time to recompile Linux server,Macrobenchmarks(cont.),Next use a commercial test suite to simulate a system under full load.,Performance Analysis,L4Linux is,on average 8.3%slower than native Linux.Only 6.8%slower at maximum load.,MkLinux:49%average,60%at maximum.,Co-located MkLinux:29%average,37%at maximum.,Extensibility Performance,A micro-kernel must provide more than just the features of the OS running on top of it.,Specialization improved implementation of Os functionality,Extensibility
展开阅读全文