Exokernel: an Operating System Architecture for Application-Level Resource Management
Total Page:16
File Type:pdf, Size:1020Kb
Exokernel: An Operating System Architecture for Application-Level Resource Management Dawson R. Engler, M. Frans Kaashoek, and James O'Toole Jr. M.I.T. Laboratory for Computer Science Cambridge, MA 02139, U.S.A engler, kaashoek, james ¡ @lcs.mit.edu ¢¤£¦¥¨§¨© § inappropriate for three main reasons: it denies applications the ad- vantages of domain-speci®c optimizations, it discourages changes Traditional operating systems limit the performance, ¯exibility, and to the implementations of existing abstractions, and it restricts the functionality of applications by ®xing the interface and implemen- ¯exibility of application builders, since new abstractions can only tation of operating system abstractions such as interprocess com- be added by awkward emulation on top of existing ones (if they can munication and virtual memory. The exokernel operating system be added at all). architecture addresses this problem by providing application-level We believe these problems can be solved through application- management of physical resources. In the exokernel architecture, a level (i.e., untrusted) resource management. To this end, we have small kernel securely exports all hardware resources through a low- designed a new operating system architecture, exokernel, in which level interface to untrusted library operating systems. Library op- traditional operating system abstractions, such as virtual memory erating systems use this interface to implement system objects and (VM) and interprocess communication (IPC), are implemented en- policies. This separation of resource protection from management tirely at application level by untrusted software. In this architecture, allows application-speci®c customization of traditional operating a minimal kernelÐwhich we call an exokernelÐsecurely multi- system abstractions by extending, specializing, or even replacing plexes available hardware resources. Library operating systems, libraries. working above the exokernel interface, implement higher-level ab- We have implemented a prototype exokernel operating system. stractions. Application writers select libraries or implement their Measurements show that most primitive kernel operations (such own. New implementations of library operating systems are incor- as exception handling and protected control transfer) are ten to 100 porated by simply relinking application executables. times faster than in Ultrix, a mature monolithic UNIX operating sys- Substantial evidence exists that applications can bene®t greatly tem. In addition, we demonstrate that an exokernel allows applica- from having more control over how machine resources are used tions to control machineresources in ways not possiblein traditional to implement higher-level abstractions. Appel and Li [5] reported operating systems. For instance, virtual memory and interprocess that the high cost of general-purpose virtual memory primitives communication abstractions are implemented entirely within an reduces the performance of persistent stores,garbage collectors,and application-level library. Measurements show that application-level distributed shared memory systems. Cao et al. [10] reported that virtual memory and interprocess communication primitives are ®ve application-level control over ®le caching can reduce application to 40 times faster than Ultrix's kernel primitives. Compared to running time by 45%. Harty and Cheriton [26] and Krueger et state-of-the-art implementations from the literature, the prototype al. [30] showed how application-speci®c virtual memory policies exokernel system is at least ®ve times faster on operations such as can increase application performance. Stonebraker [47] argued exception dispatching and interprocess communication. that inappropriate ®le-system implementation decisions can have a dramatic impact on the performance of databases. Thekkath and §¨© ¦ § Levy [50] demonstrated that exceptions can be made an order of magnitude faster by deferring signal handling to applications. Operating systems de®ne the interface between applications and To provide applications control over machine resources, an ex- physical resources. Unfortunately, this interface can signi®cantly okernel de®nes a low-level interface. The exokernel architecture is limit the performance and implementation freedom of applications. founded on and motivated by a single, simple, and old observation: Traditionally, operating systems hide information about machine the lower the level of a primitive, the more ef®ciently it can be resources behind high-level abstractions such as processes, ®les, implemented, and the more latitude it grants to implementors of address spaces and interprocess communication. These abstrac- higher-level abstractions. tions de®ne a virtual machine on which applications execute; their To provide an interface that is as low-level as possible (ideally, implementation cannot be replaced or modi®ed by untrusted appli- just the hardware interface), an exokernel designer has a single cations. Hardcoding the implementations of these abstractions is overriding goal: to separate protection from management. For instance, an exokernel should protect framebuffers without under- This research was supported in part by the Advanced Research Projects Agency under contract N00014-94-1-0985 and by a NSF National Young Investigator Award. standing windowing systems and disks without understanding ®le systems. One approach is to give each application its own virtual Copyright c 1995 by the Association for Computing Machinery, Inc. Permission to make digital or hard copies of part or all of this work for personal or classroom use machine [17]. As we discuss in Section 8, virtual machines can is granted without fee provided that copies are not made or distributed for pro®t or have severe performance penalties. Therefore, an exokernel uses a commercial advantage and that new copies bear this notice and the full citation on the different approach: it exports hardware resources rather than emu- ®rst page. Copyrights for components of this WORK owned by others than ACM must lating them, which allows an ef®cient and simple implementation. be honored. Abstracting with credit is permitted. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires An exokernel employs three techniques to export resources securely. prior speci®c permission and/or a fee. Request Permissions from Publications Dept, First, by using secure bindings, applications can securely bind to ACM Inc., Fax +1 (212) 869-0481, or [email protected] . machine resources and handle events. Second, by using visible re- source revocation, applications participate in a resource revocation stractions and show how the exokernel architecture addresses these protocol. Third, by using an abort protocol, an exokernel can break problems. secure bindings of uncooperative applications by force. ¥¨§ ¤ £¨ ¤£ "! ¢# $ ¢¤£¦¥¨§¨© §¦¥ We have implemented a prototype exokernel system based on secure bindings, visible revocation, and abort protocols. It includes an exokernel (Aegis) and an untrusted library operating system The essential observation about abstractions in traditional operating (ExOS). We use this system to demonstrate several important prop- systems is that they are overly general. Traditional operating sys- erties of the exokernel architecture: (1) exokernels can be made tems attempt to provide all the features needed by all applications. ef®cient due to the limited number of simple primitives they must As previously noted by Lampson and Sproul [32], Anderson et provide; (2) low-level secure multiplexing of hardware resources al. [4] and Massalin and Pu [36], general-purpose implementations can be provided with low overhead; (3) traditional abstractions, of abstractions force applications that do not need a given feature to such as VM and IPC, can be implemented ef®ciently at application pay substantial overhead costs. This longstanding problem has be- level, where they can be easily extended, specialized, or replaced; come more important with explosive improvements in raw hardware and (4) applications can create special-purpose implementations of performance and enormous growth in diversity of the application abstractions, tailored to their functionality and performance needs. software base. We argue that preventing the modi®cation of the implementation of these high-level abstractions can reduce the per- In practice, our prototype exokernel system provides applica- formance, increase the complexity, and limit the functionality of tions with greater ¯exibility and better performance than mono- application programs. lithic and microkernel systems. Aegis's low-level interface allows application-level software such as ExOS to manipulate resources Fixed high-level abstractions hurt application performance be- very ef®ciently. Aegis's protected control transfer is almost seven cause there is no single way to abstract physical resources or to times faster than the best reported implementation [33]. Aegis's implement an abstraction that is best for all applications. In im- exception dispatch is ®ve times faster than the best reported imple- plementing an abstraction, an operating system is forced to make mentation [50]. On identical hardware, Aegis's exception dispatch trade-offs between support for sparse or dense address spaces, and control transfer are roughly two orders of magnitude faster than read-intensive or write-intensive workloads, etc. Any such trade- in Ultrix 4.2, a mature monolithic system.