FilesQuizAllocation of Disk SpaceContiguous AllocationContiguous Allocation IssuesSlide 6External Fragmentation Solution: Linked allocationLinked AllocationLinked List AllocationSlide 10Linked List Allocation IssuesSlide 12#3. Indexed AllocationIndexed AllocationSlide 15Linked Indexed FilesMultilevel Indexed FileSingle File Access ConceptsDisk SchedulingDetailed View of a DiskSlide 21Slide 22Disk Performance Factor: SeekingDisk Performance: Other FactorsDisk Examples (Summarized Specs)Disk BehaviorsQuestionSlide 28Disk Scheduling - FIFOFIFO (FCFS) orderScheduling – Shortest Seek Time FirstSlide 32SSTF (Shortest Seek Time First)Scheduling - ScanElevator (SCAN)Scheduling – C-ScanC-SCAN (Circular SCAN)Disk LayoutFile System Implementation -PartitionsDOS File Allocation (Linked List)UNIX i-Nodes (Indexed)Free Space ManagementAlternativeMore Complex Free Space ManagementSlide 45Network File System (NFS)Examples of remote mounted file systemsLogical view: Mounted File SystemCopyright ©: Nahrstedt, Angrave, Abdelzaher 1FilesCopyright ©: Nahrstedt, Angrave, Abdelzaher2QuizA UNIX file system has 512B blocks and 4B block address pointers. What’s the max file size in bytes given what you know of the i-node structure?Copyright ©: Nahrstedt, Angrave, Abdelzaher3Allocation of Disk SpaceLow level access methods depend upon the disk allocation scheme used to store file data ContiguousLinked listBlock or indexedCopyright ©: Nahrstedt, Angrave, Abdelzaher4Contiguous AllocationCopyright ©: Nahrstedt, Angrave, Abdelzaher5Contiguous Allocation IssuesAccess method suits sequential and direct accessDirectory table maps files into starting physical address and lengthEasy to recover in event of system crashFast, often requires no head movement and when it does, head only moves one trackCopyright ©: Nahrstedt, Angrave, Abdelzaher6Contiguous Allocation IssuesFile is allocated large contiguous chunksExpanding the file requires copyingDynamic storage allocation - first fit, best fitExternal fragmentation occurs on diskCopyright ©: Nahrstedt, Angrave, Abdelzaher7External FragmentationSolution: Linked allocationCopyright ©: Nahrstedt, Angrave, Abdelzaher8Linked AllocationCopyright ©: Nahrstedt, Angrave, Abdelzaher9Linked List AllocationEach file is a linked list of chunksPointers in list are not accessible to userDirectory table maps files into head of list for a fileA node in the list can be a fixed size physical block or a contiguous collection of blocksEasy to use - no estimation of size necessaryCopyright ©: Nahrstedt, Angrave, Abdelzaher10Linked List AllocationCan grow in middle and at endsSpace efficient, little fragmentationSlow - defies the principle of locality. Need to read through linked list nodes sequentially to find record of interest blocksSuited for sequential access but not direct accessCopyright ©: Nahrstedt, Angrave, Abdelzaher11Linked List Allocation IssuesDisk space must be used to store pointers (if disk block is 512 bytes, and disk address requires 4 bytes, then the user sees blocks of 508 bytes)Not very reliable. System crashes can scramble files being updatedImportant variation on linked allocation method: `file-allocation table' (FAT) - OS/2 and MS-DOSCopyright ©: Nahrstedt, Angrave, Abdelzaher12Linked List Allocation IssuesSummary: linked allocation solves the external fragmentation and size-declaration problems of contiguous allocation,However, it can't support efficient direct accessCopyright ©: Nahrstedt, Angrave, Abdelzaher13#3. Indexed AllocationCopyright ©: Nahrstedt, Angrave, Abdelzaher14Indexed AllocationSolves external fragmentationSupports sequential, direct and indexed accessAccess requires at most one access to index block first. This can be cached in main memoryCopyright ©: Nahrstedt, Angrave, Abdelzaher15Indexed AllocationFile can be extended by rewriting a few blocks and index blockRequires extra space for index block, possible wasted spaceExtension to big files issuesCopyright ©: Nahrstedt, Angrave, Abdelzaher16Linked Indexed FilesLink full index blocks together using last entry.Copyright ©: Nahrstedt, Angrave, Abdelzaher17Multilevel Indexed File Multiple levels of index blocksCopyright ©: Nahrstedt, Angrave, Abdelzaher18Single File Access ConceptsLog Sequential Direct or HashedCopyright ©: Nahrstedt, Angrave, Abdelzaher19Disk SchedulingCopyright ©: Nahrstedt, Angrave, Abdelzaher20Detailed View of a DiskCopyright ©: Nahrstedt, Angrave, Abdelzaher21Disk SchedulingSeek timeRotation timeTransfer timeCopyright ©: Nahrstedt, Angrave, Abdelzaher22Disk SchedulingSeek timeAvg rotation time = ½ revolution timeTransfer time = (transfer speed)/(size)Copyright ©: Nahrstedt, Angrave, Abdelzaher23Disk Performance Factor: SeekingSeeking: position the head to the desired cylinderRoughly takes 2-5msSeeking speed depends on:The power available for the pivot motorhalving the seek time requires quadrupling the power)The arm’s stiffness. Accelerations of 30-40g are required to achieve good seek times, and too flexible an arm can twist and bring the head into contact with the platter surface. A seek is composed ofA speedup, a coast , a slowdown, a settleFor very short seeks, the settle time dominates (1-3ms)Copyright ©: Nahrstedt, Angrave, Abdelzaher24Disk Performance: Other FactorsRotational delayWait for a sector to rotate underneath the headsTypically 8.3 6.0 ms (7,200 – 10,000RPM) or ½ rotation takes 4.15-3msTransfer bytes Average transfer bandwidth (15-37 Mbytes/sec)Performance of transfer 1 KbytesSeek (5.3 ms) + half rotational delay (3ms) + transfer (0.04 ms)Total time is 8.34ms or 120 Kbytes/sec!What block size can get 90% of the disk transfer bandwidth?Copyright ©: Nahrstedt, Angrave, Abdelzaher25Disk Examples (Summarized Specs)Seagate BarracudaIBM Ultrastar 72ZXCapacity, Interface & ConfigurationFormatted Gbytes 28 73.4Interface Ultra ATA/66 Ultra160 SCSIPlatters / Heads 4 / 8 11/22Bytes per sector 512 512-528PerformanceMax Internal transfer rate (Mbytes/sec) 40 53Max external transfer rate (Mbytes/sec) 66.6 160Avg Transfer rate( Mbytes/sec) > 15 22.1-37.4Multisegmented cache (Kbytes) 512 16,384Average seek, read/write (msec) 8 5.3Average rotational latency (msec) 4.16 2.99Spindle speed (RPM) 7,200 10,000Copyright ©: Nahrstedt, Angrave, Abdelzaher26Disk BehaviorsThere
View Full Document