Ext2 On SingularityExt2 DefinedMicrosoft Research’s SingularityMy GoalsOverview of ResultsOutlineSingularityProgramming EnvironmentProcess ModelCommunication ChannelsDisk Read ExampleSlide 12Slide 13Slide 14Slide 15Slide 16Ext2 ImplementationRequired PiecesExt2 Client ManagerExt2 ControlExt2FsFile Read SequenceFile Read Sequence 2CachingResultsTestingSlide 27Slide 28Slide 29Slide 30ConclusionQuestionsExtrasSlide 34Slide 35Slide 36Slide 37Scott FinleyUniversity of Wisconsin – MadisonCS 736 ProjectBasic, default Linux file systemAlmost exactly the same as FFS◦Disk broken into “block groups”◦Super-block, inode/block bitmaps, etc.New from the ground upReliability as #1 goalReevaluate conventional OS structureLeverage advances of the last 20 years◦Languages and compilers◦Static analysis of whole systemImplement Ext2 on SingularityFocus on read support with cachingInvestigate how Singularity design impact FS integrationInvestigate performance implicationsI have a Ext2 “working” on Singularity◦Reading fully supported◦Caching improves performance!◦Limited write supportSingularity design◦Garbage collection hurts performance◦Reliability is good: I couldn’t crash it.1. Singularity Details2. Details of my Ext2 implementation3. ResultsEverything is written in C#◦Small pieces of kernel (< 5%) in assembly and C++ as neededKernel and processes are garbage collectedNo virtual machine◦Compiled to native codeVery aggressive optimizing compilerSingularity is a micro kernelEverything else is a SIP◦“Software Isolated Process”No hardware based memory isolation◦SIP “Object Space” isolation guaranteed by static analysis and safe language (C#)◦Context switches are much fasterAll SIP communication is via message channelsNo shared memoryMessages and data passed via Exchange HeapObject ownership is trackedZero copy data passing via pointersApplication creates buffer in ExHeapAppFile SystemDisk DriverExchange HeapEmpty BufferApplication send read request to file system◦File system owns the bufferAppFile SystemDisk DriverExchange HeapEmpty BufferFile system sends read request to driver◦Driver owns the bufferAppFile SystemDisk DriverExchange HeapEmpty BufferDriver fills buffer and replies to file systemAppFile SystemDisk DriverExchange HeapFull BufferFile system replies to applicationAppFile SystemDisk DriverExchange HeapFull BufferApplication consumes the bufferAppFile SystemDisk DriverExchange HeapExt2Control: Command line applicationExt2ClientManager: Manages mount pointsExt2FS: Core file system functionalityExt2Contracts: Defines communicationSystem service (SIP) launched at bootAccessible at known location in /dev directoryDoes “Ext2 stuff”Operates on Ext2 volumes and mount pointsExports “Mount” and “Unmount”◦Would also provide “Format” if implemented300 lines of codeCommand line applicationAllows Ext2 Client Manger interface accessNot used by other applications500 lines of codeCore Ext2 file system.Separate instance (SIP) for each mount point.◦Exports “Directory Service Provider” interfaceClients open files and directories by attaching a communication channel◦Internally paired with an Inode.Reads implemented, Writes in progress2400 Lines of codeClient wants to read file “/mnt/a/b.txt”◦Ext2 mounted at “/mnt”1.App --CH0-->SNS: <Bind,“/mnt/a/b.txt”,CH1>2.App<--CH0-- SNS: <Reparse, “/mnt”>3.App --CH0-->SNS: <Bind,”/mnt”,CH1>4.App<--CH0-- SNS: <AckBind>5. App --CH1-->Ext2Fs: <Bind,“/a/b.txt”,CH2>6. App<--CH1-- Ext2Fs: <AckBind>7. App --CH2-->Ext2Fs: <Read, Buff, BOff, FOff>8. App<--CH2-- Ext2Fs: <ReadAck, Buff>9. …1. Inodes: Used on every access2. Block Numbers: Very important for large files3. Data Blocks: Naturally captures othersAll use LRU replacementLarge files unusable without caching◦8300X faster reading 350 MB fileAthlon 64 3200, 1 GB RAMDisk: 120GB, 7200 RPM, 2 MB buffer, PATAMeasured sequential readsVaried read buffer size from 4 KB to 96 MBTimed each requestFile sizes ranged from 13 MB to 350 MBLinux is faster◦Not clear that this is fundamentalPerformance is not horrible◦“Good enough” objective met◦Garbage collection overhead < 0.1%Not sensitive to file sizeSystem programming in a modern languageSystem programming with no crashesMicro kernel is feasible◦Hurts feature integration: mmap, cache sharing◦Clean, simple
View Full Document