FreeSpace Management - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

FreeSpace Management

Description:

disk cache separate section of main memory for frequently sued blocks ... Disk is much slower than memory ... Recovery ... – PowerPoint PPT presentation

Number of Views:602
Avg rating:3.0/5.0
Slides: 15
Provided by: steve1802
Category:

less

Transcript and Presenter's Notes

Title: FreeSpace Management


1
Free-Space Management
  • Need to protect
  • Pointer to free list
  • Bit map
  • Must be kept on disk
  • Copy in memory and disk may differ.
  • Cannot allow for blocki to have a situation
    where biti 1 in memory and biti 0 on
    disk.
  • Solution
  • Set biti 1 in disk.
  • Allocate blocki
  • Set biti 1 in memory

2
Directory Implementation
  • Linear list of file names with pointer to the
    data blocks.
  • simple to program
  • time-consuming to execute
  • Hash Table linear list with hash data
    structure.
  • decreases directory search time
  • collisions situations where two file names hash
    to the same location
  • fixed size

3
Efficiency and Performance
  • Efficiency dependent on
  • disk allocation and directory algorithms
  • types of data kept in files directory entry
  • Performance
  • disk cache separate section of main memory for
    frequently sued blocks
  • free-behind and read-ahead techniques to
    optimize sequential access
  • improve PC performance by dedicating section of
    memory as virtual disk, or RAM disk.

4
File System Performance (1)
  • The block cache data structures

5
File System Performance (2)
  • I-nodes placed at the start of the disk
  • Disk divided into cylinder groups
  • each with its own blocks and i-nodes

6
Improving performance
  • Disk is much slower than memory
  • Controller has on-board memory for complete
    tracks - sectors and blocks are delivered
  • Not so simple to use - multiprocessing...
  • Readahead need one block ? read more
  • Sequential access Readahead and Freebehind
  • Prevent lost data
  • periodic SYNC (write all buffers)
  • write-through caches (MS-DOS)
  • Free memory can be shared for cache uses of disk
    blocks and for memory pages (SUN Unix)

7
Various Disk-Caching Locations
8
Buffer Cache - Retrieval
  • Five possible scenarios when the kernel retrieves
    a block
  • 1. The block is found in its hash queue AND is
    free
  • the buffer is marked busy
  • buffer is removed from free list
  • 2. No block is found in the hash queue - a free
    block is allocated from the free list
  • 3. No block is found in the hash queue AND in
    searching the free list for a free block a
    delayed-write buffer is found (or more) -
    write delayed-write buffer(s) to disk, move them
    to head of list (LRU) and find a free buffer
  • 4. No block is found in the hash queue AND free
    list empty block requesting process, when
    scheduled, go through hash-queue again
  • 5. The block is found in its hash queue AND is
    busy process sleeps until a buffer is freed,
    then starts algorithm again..

9
Caching in Windows 2000
  • The path through the cache to the hardware

10
Log-Structured File Systems
  • With CPUs faster, memory larger
  • disk caches can also be larger
  • increasing number of read requests can come from
    cache
  • thus, most disk accesses will be writes
  • LFS Strategy structures entire disk as a log
  • have all writes initially buffered in memory
  • periodically write these to the end of the disk
    log
  • when file opened, locate i-node, then find blocks

11
Recovery
  • Consistency checker compares data in directory
    structure with data blocks on disk, and tries to
    fix inconsistencies.
  • Use system programs to back up data from disk to
    another storage device (floppy disk, magnetic
    tape).
  • Recover lost file or disk by restoring data from
    backup.

12
File System Reliability (1)
File that has not changed
  • A file system to be dumped
  • squares are directories, circles are files
  • shaded items, modified since last dump
  • each directory file labeled by i-node number

13
File System Reliability (2)
  • Bit maps used by the logical dumping algorithm

14
File System Reliability (3)
  • File system states
  • (a) consistent
  • (b) missing block
  • (c) duplicate block in free list
  • (d) duplicate data block
Write a Comment
User Comments (0)
About PowerShow.com