One Seek File System - PowerPoint PPT Presentation

About This Presentation
Title:

One Seek File System

Description:

Sharath R. Cholleti. Fixed size blocks. Blocks could be non-contiguous ... Sharath R. Cholleti. Extent based File System ... Each file is stored big to small ... – PowerPoint PPT presentation

Number of Views:26
Avg rating:3.0/5.0
Slides: 36
Provided by: Shar224
Category:
Tags: big | file | one | seek | system

less

Transcript and Presenter's Notes

Title: One Seek File System


1
One Seek File System
Sharath R. Cholleti sharath_at_cs.wustl.edu
Center for Distributed Object Computing Department
of Computer Science and Engineering Washington
University
Fall 03 E71 CS 6785 Programming Languages
Seminar 07 Nov 2003
2
Outline
  • Fixed size blocks file system
  • Extent based file system
  • Buddy system
  • Buddy file system
  • Sum of powers of 2 blocks
  • Experiments
  • Heap manager algorithm
  • Defragmentation
  • Bounds

3
Fixed size blocks
  • Blocks could be non-contiguous
  • Could be spread all over the disk
  • Number of seeks proportional to file size
  • O(S)

4
Extent based File System
  • Limited number of extents per file
  • An extent can be of arbitrarily large
  • Number of seeks is limited
  • O(1)
  • Problems
  • Difficult to predict the size of the extents
  • Cross the limit of number of extents per file
  • Variable size gives rise to fragmentation
  • DTSS shown to be practical without too much
    internal or external fragmentation

5
Knuths Buddy System
  • Free lists segregated by size

128
64
32
  • All the requests are rounded up to a power of 2

16
8
4
2
1
6
Buddy System (1)
  • Begin with one large block
  • Suppose we want a block of size 8

128
64
32
16
8
4
2
1
7
Buddy System (2)
  • Begin with one large block
  • Suppose we want a block of size 8
  • Subdivide recursively

128
64
32
16
8
4
2
1
8
Buddy System (3)
  • Begin with one large block
  • Suppose we want a block of size 8
  • Subdivide recursively

128
64
32
16
8
4
2
1
9
Buddy System (4)
  • Begin with one large block
  • Suppose we want a block of size 8
  • Subdivide recursively

128
64
32
16
8
4
2
1
10
Buddy System (5)
  • Begin with one large block
  • Suppose we want a block of size 8
  • Subdivide recursively
  • 2 blocks of size 8

128
64
32
16
8
4
2
1
11
Buddy System (6)
  • Begin with one large block
  • Suppose we want a block of size 8
  • Subdivide recursively
  • 2 blocks of size 8
  • One of those given to the program

128
64
32
16
8
4
Given to the program
2
1
12
Buddy System (7)
  • Coalescing
  • Only buddies coalesce

128
64
32
16
8
4
Deallocated
2
1
13
Buddy File System
  • Round the file size to a power of 2
  • Only one large block
  • Mostly only 1 seek
  • Fast allocation
  • Deallocation coalescing with its buddy
  • High internal fragmentation
  • Worse case almost 50
  • Average 25

14
Buddy System Tree Notation
Free
Allocate block of size 1
Occupied
16
8
4
2
1
15
Buddy System Tree Notation(2)
Free
Allocate block of size 1
Occupied
16
8
4
2
1
16
Buddy System Tree Notation(3)
Free
Allocate block of size 1
Occupied
16
8
4
2
1
17
Buddy System Tree Notation(4)
Free
Allocate block of size 1
Occupied
16
8
4
2
1
18
Buddy System Tree Notation(6)
Free
Allocate block of size 4
Occupied
16
8
4
2
1
19
Sum of powers of 2 blocks
Free
  • Buddy blocks of different sizes
  • 13 8 4 1

Occupied
32
16
8
4
2
1
20
Allocation as Sum of powers of 2 blocks
  • Internal fragmentation same as file system with
    blocks of equal size
  • Buddy type coalescing helps control the external
    fragmentation
  • Number of seeks is O(log S)
  • What if allocate the blocks contiguously?
  • Or make it contiguous after allocation
  • Only one seek necessary

21
Experiments
  • CEC data
  • user file sizes
  • Usual (blocks of same size) vs Buddy vs Sum of
    powers of 2
  • Total blocks (segments)
  • Wasted space
  • Min/avg/max number of segments

22
Total number of blocks (segments)
23
Wasted space
24
Min/Avg/Max number of blocks
25
Results
  • Sum of powers of 2
  • Much lesser internal fragmentation compared to
    buddy
  • Very few blocks compared to fixed block size file
    system
  • Experiments to limit the number of segments to a
    constant

26
Heap Manager Algorithm
16
8
8
5
3
4
1
4
3
0
1
02
2
1
0
0
2
1
27
Defragmentation
  • Need to allocate a block of size 8
  • No free block of size 8 -- relocate

Free
Occupied
32
16
8
4
2
1
28
Defragmentation (2)
  • Need to allocate a block of size 8
  • No free block of size 8 -- relocate

Free
Occupied
32
16
8
4
2
1
29
Cost
  • M disk size
  • Allocation O(logM)
  • Deallocation O(logM)
  • Relocation O(slogM) file of size s

30
Defragmentation Theory Assumptions
  • All files are stored contiguously
  • Each file is stored big to small
  • File of size S, 2nltSlt2(n1), lies entirely
    within a buddy block of 2(n1)
  • Unit of the file is a block
  • There is a way to allocate or relocate a file

31
Bound on relocated file size
  • For the relocation to be minimum, allocation of a
    file of size 2n does not relocate file of size
    greater than 2(n-1)
  • Proof
  • X a file or a set of files
  • R(X) number of blocks moved to relocate X

32
Proof (cont)
B
a
D
E
R R(a) R(B) a R(D) R(B) gt E
R(D) R(B)
33
Proof (cont)
B
a
D
E
34
Worst case relocation file size
  • In worst case, to allocate a file of size 2n,
    two files of size 2(n-1) are relocated

35
Worst Case Defragmentation
  • Worst-case relocation for a file of size S
  • SlogS blocks
  • R(S) S 2R(S/2)
  • 2(S-1) files
  • R(S) 1 2R(S/2)
Write a Comment
User Comments (0)
About PowerShow.com