Course Hero Logo

Indexed scheme when file sizes surpass a certain

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 7 - 9 out of 13 pages.

indexed scheme when file sizes surpass a certain threshold.And of course some systems adjust their allocation schemes ( e.g. block sizes ) to best match the characteristicsof the hardware for optimum performance.12.5 Free-Space ManagementAnother important aspect of disk management is keeping track of and allocating free space.12.5.1 Bit VectorOne simple approach is to use abit vector, in which each bit represents a disk block, set to 1 if free or 0 ifallocated.Fast algorithms exist for quickly finding contiguous blocks of a given sizeThe down side is that a 40GB disk requires over 5MB just to store the bitmap. ( For example. )12.5.2 Linked ListA linked list can also be used to keep track of all free blocks.Traversing the list and/or finding a contiguous block of a given size are not easy, but fortunately are notfrequently needed operations. Generally the system just adds and removes single blocks from the beginning ofthe list.The FAT table keeps track of the free list as just one more linked list on the table.
Figure 12.10 - Linked free-space list on disk.12.5.3 GroupingA variation on linked list free lists is to use links of blocks of indices of free blocks. If a block holds up to Naddresses, then the first block in the linked-list contains up to N-1 addresses of free blocks and a pointer to thenext block of free addresses.12.5.4 CountingWhen there are multiple contiguous blocks of free space then the system can keep track of the starting addressof the group and the number of contiguous free blocks. As long as the average length of a contiguous group offree blocks is greater than two this offers a savings in space needed for the free list. ( Similar to compressiontechniques used for graphics images when a group of pixels all the same color is encountered. )12.5.5 Space MapsSun's ZFS file system was designed for HUGE numbers and sizes of files, directories, and even file systems.The resulting data structures could be VERY inefficient if not implemented carefully. For example, freeing up a 1GB file on a 1 TB file system could involve updating thousands of blocks of free list bit maps if the file wasspread across the disk.ZFS uses a combination of techniques, starting with dividing the disk up into ( hundreds of )metaslabsof amanageable size, each having their own space map.Free blocks are managed using the counting technique, but rather than write the information to a table, it isrecorded in a log-structured transaction record. Adjacent free blocks are also coalesced into a larger single freeblock.An in-memory space map is constructed using a balanced tree data structure, constructed from the log data.The combination of the in-memory tree and the on-disk log provide for very fast and efficient management ofthese very large files and free blocks.12.6 Efficiency and Performance12.6.1 EfficiencyUNIX pre-allocates inodes, which occupies space even before any files are created.UNIX also distributes inodes across the disk, and tries to store data files near their inode, to reduce the distanceof disk seeks between the inodes and the data.

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 13 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
N/A
Tags

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture