2. Overview
• Introduction to operating systems structure
• Layered OS structure
• Some alternative OS structures
• “Application Performance and Flexibility on Exokernel
Systems” paper discussion
4. Introduction to OS structure
• An OS needs to have a good structure.
• Traditional Unix OS which had a
monolithic structure - bad
• Monolithic Unix kernel makes it hard to
implement and maintain.
5. Layered OS structure
Problems with monolithic approach gave way to layered
approach.
Advantages Disadvantages
Simplicity of construction Difficulty in appropriately defining
the various layers
Ease of debugging Tend to be less efficient than
other types
Layers are independent of
6. Some Alternative OS Structures
• Microkernel approach
• Modular kernel approach
• Exokernel approach
7. Application Performance & Flexibility on
Exokernel Systems
*
• Principles of exokernels
• Xok, an exokernel for Intel x86-based computers
• XN - Xok storage system
• Performance comparisons
• Conclusion
• Q & A
8. Principles of Exokernels
• Separate protection and management
• Expose allocation
• Expose names
• Expose revocation
• Expose information
*
9. • Library operating systems.
• “Unix as a library”
• Can implement traditional OS abstraction.
• Most application programs can choose the LibOS.
• Unprivileged libraries – can be modified or replaced at will.
• Different libOSes can coexist on the top of same exokernel.
*
LibOSs
11. *
Xok
Xok is an exokernel for Intel x86-based computers.
• Can safely multiplex resources on x86 based systems.
• Allows efficient and powerful virtual memory abstractions to be built at the
application level.
• Wake up predicates can be injected to the kernel.
• Provides access control through hierarchical named capabilities.
12. • Xok’s 3 design techniques:
● Access control on all resources is uniform.
● Bind hardware together with software abstractions.
● Allow downloaded code where necessary.
*
Xok : Protected Abstractions
13. LibOSs can maintain invariants in shared abstractions,
• Software regions
• Hierarchically-named capabilities
• Wake-up predicates
• Robust critical sections
Three levels of trust in determining what optimizations can be used,
• Mutual trust
• Unidirectional trust
• Mutual distrust
*
Xok : Protected Sharing
14. • ExOS is Xok’s default library.
• Much code borrowed from OpenBSD.
*
EXOS
15. • Multiple library file systems (libFSes) in each libOS
• Four requirements to allow libFS file management
● Creating new file formats should not require any special privilege
● LibFSes should be able to safely share blocks at the raw disk block level
● Storage system should be efficient
● Storage system should facilitate cache sharing among distinct libFSes.
Stable Storage System
*
17. • Access to stable storage at the level of disk blocks.
• Efficiently determine the access rights to a given disk block.
• Prevent a malicious user from claiming another user’s disk blocks as part of her
own files
• XN uses Untrusted Deterministic Functions(UDF)
• C-FFS (Co-locating fast file system) is ExOS’s default file system.
*
XN : Xok Storage System
18. *
XN : Usage
Type creation The libFS describes its types by storing templates.
LibFS persistence To ensure that libFS data is persistent across reboots, a libFS can register the root of its tree
in XN’s root catalogue.
Startup libFS loads its root(s) and any types it needs from the root catalogue into the buffer cache
registry.
Read 1) libFS creates entries in the registry.
2) libFS initiates a read request
Allocate A libFS selects blocks to allocate by reading XN’s map of free blocks.
Write A libFS writes dirty blocks to disk by passing the blocks to write to XN
Deallocate XN uses UDFs to check deallocate operations analogously to allocate operations.
20. • Configuration, 200-MHz Intel Pentium Pro, 64MB of memory
• E2E application performance on Xok vs 4.4 BSD UNIX Systems
(FreeBSD & OpenBSD)
• Usage of C-FFS to Xok & OPenBSD
• Reported times are the minimum time of ten trials
• Xok/ExOS vs OpenBSD/C-FFS, vs OpenBSD, FreeBSD
*
Performance Comparison
23. Unmodified UNIX applications
● Applications perform comparably or significantly better at a
speed of up to 4x on Xok/ExOS than BSD UNIXes.
● Performance of 8/11 applications are comparable to BSD
Unixes.
● On 3 applications (pax, cp, diff) Xok/ExOS runs considerably
faster. *
Performance Evaluation
24. Modified Andrew Benchmark
• Difference in performance on MAB is less profound
● MAB stresses in fork(), expensive function in Xok
● Due to not sharing page tables
● Take 6 ms, freeBSD < 1 ms
• Xok leads in I/O intensive benchmark *
Invisible Optimisation
Xok/ExO
S
OpenBSD/C-
FFS
OpenBSD FreeBSD
TIme (s) 11.5 12.5 14.2 11.5
25. Modified UNIX applications
• Fast Simple Binary Emulation
● Emulator replaces system calls to procedure calls in to ExOS
• XCP : A zero touch file copy system
● Eliminate data touching by CPU, 3X faster
● Improvements - Prefetching, SUny reads/Writes, disk restructuring
• The Cheetah Http Server *
Performance Evaluation 2
26. Modified UNIX applications
• HTTP server - Finds the appropriate document, sends it.
• Developed upon extensible I/O library(XIO) for fast servers
• Customized FS & TCP implementation for the properties of HTTP
traffic.
• I/O centric nature of servers, OS based optimizations profitable.
*
Cheetah HTTP Server
27. • Performs 8X faster than the best UNIX HTTP server.
• Exokernel is well suited to building fast servers
*
Cheetah HTTP Server
28. • Merged File Cache and Retransmission Pool
● Avoid in memory data touching
● Data transmitted to client directly, from file cache.
• Knowledge-based Packet Merging
● Use knowledge of per-request state transitions to reduce number of I/O actions.
• HTML-based File Grouping
Co-locates files included in HTML by allocating them in adjacent disk blocks, HTTP
throughput improved by up to a factor of two
Cheetah HTTP Server, How ...
File
Cache
Client
30. • Run multiple applications concurrently
• Exokernel Architecture is potentially weak
• Not extensively studied
• FreeBSD performs better than openBSD, due to small non-unified
buffer cache
• Challenge in Xok, Not to enforce global policies, but to deriving
information needed to decide enforcement. *
Global Performance
31. Exposing kernel data structures
• Can be accessed without system call overhead
• Flexibility
• libOSes can be modified and debugged than kernels
• Edit, compile, debug cycle is faster than “edit, compile, reboot, debug”
cycle of kernel.
• Performance *
Exokernel : Advantages
32. *
Exokernel : Advantages
The CPU Interface
• Combination of time slots
• Initiation/termination of upcalls
• Direct Yields has proven the value
• Global gang scheduling
• Robust critical section
Libraries are simple than kernels
33. • Interface design is not simple, multiple designs over several years
• Ease of creation/mixing libOSes lead to code messes, maintenance
issues
• Information loss, Implementing OS abstractions in application level
• Self-paging is difficult, paging can be caused by external entities
*
Exokernel : Drawbacks
34. • Fast apps not required good microbenchmark performance
• Inexpensive critical section
• User level page tables are complex
• Downloaded interrupt handlers are questionable
• Downloaded code is powerful
*
Exokernel : Lessons
35. Exokernel Architecture
• Goal: safe application control of all resources.
• How: by separating resource management from protection.
Results found promising
• Unmodified applications run same or 4x better.
• Customized applications can run up to 8x better.
• Global performance is similarly good like UNIX. *
Conclusion