Docsity

Disk Management in High Performance Computing: Contiguous, Linked, and Indexed Allocation, Slides of Computer Science

Partial preview of the text

Download Disk Management in High Performance Computing: Contiguous, Linked, and Indexed Allocation and more Slides Computer Science in PDF only on Docsity!

High Performance Computing

Lecture 35

2

About Disks

 Our view of disk: linear address space of

fixed size sectors/blocks numbered from

0 up

4

Common File Access Patterns

 Sequential access: bytes of file are read in order from start to finish  Reading a file from start to end  e.g., cat program.c  Random access: bytes of file are read in some (random) order  e.g., Query to a database file

5

File System Design Issues

  1. Disk management: efficient use of disk space
  2. Name management: how users select files for use
  3. Protection: of files from users

7

Disk Block Allocation

 Question: How does the OS keep track of which disk blocks are associated with a given file?  Consider a file that is 10 disk blocks in size  File Descriptor: OS structure that describes which blocks on disk represent a file  Issues:

  1. Take common file access patterns into account
  2. It must be possible for files to change in size

8

Disk Block Allocation: Contiguous

File is stored in contiguous blocks on disk  File descriptor: first block address, file size 17 20 94 99 File 1: Size 4 blocks; Blocks 17, 18, 19, 20 File 2: Size 6 blocks; Blocks 94, 95, 96, 97, 98, 99 File 1: Start 17 Size 4 File 2: Start 94 Size 6

10

Disk Block Allocation: Indexed

File Index is an array containing addresses of 1 st , 2 nd , etc block of file  File descriptor: index File 1: Size 4 blocks; Blocks 17, 84, 14, 99 14 17 84 99 17 84 14 99 1 2 3 4 INDEX Problem: size of the index?

11

UNIX Version of Indexed Allocation

1 2 3 4 5 6 7 8 9 10 11 12 Disk block addresses of file Indirect disk block address Doubly indirect disk block address Triply indirect disk block address Assume disk block size: 1KB, disk block address size: 4B 9KB + 256KB

  • 256256 KB +256256*256 KB Maximum file size:
  • address of disk block containing more disk block addresses of the file