Slide 1Ext2 DefinedMicrosoft Research’s SingularityMy GoalsOverview of ResultsOutlineSingularityProgramming EnvironmentProcess ModelCommunication ChannelsDisk Read ExampleDisk Read ExampleDisk Read ExampleDisk Read ExampleDisk Read ExampleDisk Read ExampleExt2 ImplementationRequired PiecesExt2 Client ManagerExt2 ControlExt2FsFile Read SequenceFile Read Sequence 2CachingResultsTestingSlide 27Slide 28Slide 29ResultsConclusionQuestionsExtrasSlide 34Slide 35Slide 36Slide 37Ext2 On SingularityScott 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.Ext2 DefinedNew from the ground upReliability as #1 goalReevaluate conventional OS structureLeverage advances of the last 20 years◦Languages and compilers◦Static analysis of whole systemMicrosoft Research’s SingularityImplement Ext2 on SingularityFocus on read support with cachingInvestigate how Singularity design impact FS integrationInvestigate performance implicationsMy GoalsI 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.Overview of Results1. Singularity Details2. Details of my Ext2 implementation3. ResultsOutlineSingularityEverything 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 compilerProgramming EnvironmentSingularity 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 fasterProcess ModelAll SIP communication is via message channelsNo shared memoryMessages and data passed via Exchange HeapObject ownership is trackedZero copy data passing via pointersCommunication ChannelsApplication creates buffer in ExHeapDisk Read ExampleAppFile SystemDisk DriverExchange HeapEmpty BufferApplication send read request to file system◦File system owns the bufferDisk Read ExampleAppFile SystemDisk DriverExchange HeapEmpty BufferFile system sends read request to driver◦Driver owns the bufferDisk Read ExampleAppFile SystemDisk DriverExchange HeapEmpty BufferDriver fills buffer and replies to file systemDisk Read ExampleAppFile SystemDisk DriverExchange HeapFull BufferFile system replies to applicationDisk Read ExampleAppFile SystemDisk DriverExchange HeapFull BufferApplication consumes the bufferDisk Read ExampleAppFile SystemDisk DriverExchange HeapExt2 ImplementationExt2Control: Command line applicationExt2ClientManager: Manages mount pointsExt2FS: Core file system functionalityExt2Contracts: Defines communicationRequired PiecesSystem 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 codeExt2 Client ManagerCommand line applicationAllows Ext2 Client Manger interface accessNot used by other applications500 lines of code Ext2 ControlCore 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 codeExt2FsClient 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>File Read Sequence5. 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. …File Read Sequence 21. 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 fileCachingResultsAthlon 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 MBTesting2,048 20,480 204,800 2,048,000 20,480,000 204,800,00005101520253035350MB File Sequential ReadLinuxAverage4 KB8 KB16 KB64 KB256 KB1 MB8 MB64 MB96 MBColdBuffer Size (Bytes)Read Speed (MB/S)05101520253035Request Service Time for reads of 350 MB file with 16 KB buffersTimeRequest Service Time (ms)05101520253035200 Sequential 16 KB Buffer Reads of 350 MB FileTimeRead Speed (MB/s)Linux is faster◦Not clear that this is fundamentalPerformance is not horrible◦“Good enough” objective met◦Garbage collection overhead < 0.1%Not sensitive to file sizeResultsSystem programming in a modern languageSystem programming with no crashesMicro kernel is feasible◦Hurts feature integration: mmap, cache sharing◦Clean, simple interfacesConclusionQuestionsExtras2,048 20,480 204,800 2,048,000 20,480,000 204,800,0000510152025303513 MB File Sequential ReadLinuxAverage4 KB8 KB16 KB64 KB256 KB1 MB8 MB64 MB96 MBColdBuffer Size (Bytes)Read Speed (MB/S)0510152025303564 KB Buffer Reads of 350 MB FileTimeRead Speed (MB/s)05101520253064 MB Buffer Reads of 350 MB FileTimeRead Speed (MB/s)2,048 20,480 204,800 2,048,000 20,480,000 204,800,000051015202530Average Sequential Read Speeds13 MB File350 MB FileBuffer SizeRead Speed
View Full Document