Free Space Management.

Slides:



Advertisements
Similar presentations
Chapter 11: File System Implementation
Advertisements

File System Implementation
File System Implementation
Chapter 11: File System Implementation. File-System Structure File-System Implementation Directory Implementation Allocation Methods Free-Space Management.
Chapter 11: Implementing File Systems
Chapter 12: File System Implementation
1 Operating Systems Chapter 7-File-System File Concept Access Methods Directory Structure Protection File-System Structure Allocation Methods Free-Space.
Chapter 11: File System Implementation. 2 File System Implementation File System Implementation File-System Structure File-System Implementation Directory.
File System Structure §File structure l Logical storage unit l Collection of related information §File system resides on secondary storage (disks). §File.
04/05/2004CSCI 315 Operating Systems Design1 File System Implementation.
File System Implementation
04/07/2010CSCI 315 Operating Systems Design1 File System Implementation.
File Concept §Contiguous logical address space §Types: l Data: Numeric Character Binary l Program.
Dr. Kalpakis CMSC 421, Operating Systems File System Implementation.
Operating Systems CMPSC 473 I/O Management (4) December 09, Lecture 25 Instructor: Bhuvan Urgaonkar.
Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 11: File System Implementation.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials– 8 th Edition Chapter 10: File System Implementation.
Chapter 11: File System Implementation Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 File-System Structure.
Lecture 9: File Systems. Lecture 9 / Page 2AE4B33OSS Silberschatz, Galvin and Gagne ©2005 Contents Files & File System Interface Directories & their Organization.
Dr. T. Doom 11.1 CEG 433/633 - Operating Systems I Chapter 11: File-System Implementation File structure –Logical storage unit –Collection of related information.
Silberschatz and Galvin  Operating System Concepts File-System Implementation File-System Structure Allocation Methods Free-Space Management.
Page 111/15/2015 CSE 30341: Operating Systems Principles Chapter 11: File System Implementation  Overview  Allocation methods: Contiguous, Linked, Indexed,
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 12: File System Implementation File System Structure File System Implementation.
XE33OSA Chapter 11: File System Implementation. 11.2XE33OSA Silberschatz, Galvin and Gagne ©2005 Chapter 11: File System Implementation Chapter 11: File.
File System Implementation
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 11: File System Implementation.
Chapter 11: File System Implementation Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 Implementation.
12.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 12: File System Implementation Chapter 12: File System Implementation.
Module 4.0: File Systems File is a contiguous logical address space.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 11: File-System Interface File Concept Access Methods Directory Structure.
Ridge Xu 12.1 Operating System Concepts Chapter 12: File System Implementation File System Structure File System Implementation Directory Implementation.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 11-2: File System Implementation Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
12.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 12: File System Implementation Chapter 12: File System Implementation.
Chapter 11: File System Implementation Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 11: File System Implementation Chapter.
Chapter 11: File System Implementation Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 11: File System Implementation Chapter.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 12: File System Implementation File System Structure File System Implementation.
Modul ke: Fakultas Program Studi File System Implementation SISTEM OPERASI Misbahul Fajri, ST., MTI. 1 FASILKOM Teknik Informatika.
Disk & File System Management Disk Allocation Free Space Management Directory Structure Naming Disk Scheduling Protection CSE 331 Operating Systems Design.
10.1 CSE Department MAITSandeep Tayal 10 :File-System Implementation File-System Structure Allocation Methods Free-Space Management Directory Implementation.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 11 File-System Implementation Slide 1 Chapter 11: File-System Implementation.
Operating Systems CMPSC 473 I/O Management (3) December 07, Lecture 24 Instructor: Bhuvan Urgaonkar.
Chapter 11: File System Implementation Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 File-System Structure.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition File System Implementation.
Chapter 11: File System Implementation Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 11: File System Implementation Chapter.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 11: File System Implementation.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 12: File System Implementation File System Structure File System Implementation.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 12: File System Implementation.
Operating Systems 1 K. Salah Module 4.0: File Systems  File is a contiguous logical address space (of related records)  Access Methods  Directory Structure.
11.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles 11.5 Free-Space Management Bit vector (n blocks) … 012n-1 bit[i] =  1  block[i]
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 12: File System Implementation.
File-System Management
Chapter 12: File System Implementation
File-System Implementation
Chapter 11: File System Implementation
Chapter 11: File System Implementation
Chapter 12: File System Implementation
Chapter 14: File System Implementation
Chapter 11: File System Implementation
Chapter 11: File System Implementation
Overview Continuation from Monday (File system implementation)
Outline Allocation Free space management Memory mapped files
Chapter 11: File System Implementation
Overview: File system implementation (cont)
File-System Structure
Chapter 14: File System Implementation
Chapter 14: File-System Implementation
Chapter 11: File System Implementation
File System Implementation
Presentation transcript:

Free Space Management

Bit Vector Simple and efficient to find the first free block, or consecutive free blocks By bit-manipulation Requires extra space block size = 212 bytes disk size = 230 bytes n = 230/212 = 218 bits (or 32K bytes) Efficient only when the entire vector is kept in main memory Write back to the disk occasionally for recovery needs 1 2 n-1 … 0  block[i] free 1  block[i] occupied bit[i] =  001111001111100011000011100… Question: What’s the block # of the fist free block?

Linked List Link together all free blocks Keep a pointer to the first free block in a special location on the disk and caching it in memory Cannot get contiguous space easily No waste of space Not efficient: have to traverse the disk for free spaces Usually, OS needs one free block at a time FAT incorporate the linked list mechanism

Grouping And Counting Grouping: store the address of n free blocks in the first free block. The first n-1 are actually free. The final block contains the addresses of another n free blocks… Counting: Each entry has a disk address and a count Several contiguous blocks may be allocated or freed simultaneously

Example Of Free-Space Management Bit Vector 11000011000000111001111110001111 Grouping Block 2  3, 4, 5 Block 5  8, 9, 10 Block 10  11, 12, 13 Block 13  17, 28, 25 Block 25  26, 27 Counting 2 4 8 6 17 2 25 3

Efficiency and Performance

Efficiency and Performance Efficiency dependent on Disk allocation and directory algorithms Types of data kept in file’s directory entry Performance On-board cache – local memory in disk controller to store entire tracks at a time Disk cache – separate section of main memory for frequently used blocks (LRU is a reasonable algorithm for block replacement) Free-behind and read-ahead – techniques to optimize sequential access (optimize the disk cache’s block replacement algorithm) Improve PC performance by dedicating section of memory as virtual disk, or RAM disk.

Various Disk-Caching Locations

Page Cache Non-unified buffer cache Unified Buffer Cache A page cache caches pages rather than disk blocks using virtual memory techniques Memory-mapped I/O uses a page cache Routine I/O through the file system uses the buffer (disk) cache Unified Buffer Cache A unified buffer cache uses the same buffer cache to cache both memory-mapped pages and ordinary file system I/O

I/O Without/With A Unified Buffer Cache

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

Log Structured File Systems Log structured (or journaling) file systems record each update to the file system as a transaction All transactions are written to a log. A transaction is considered committed once it is written to the log However, the file system may not yet be updated The transactions in the log are asynchronously written to the file system. When the file system is modified, the transaction is removed from the log If the file system crashes, all remaining transactions in the log must still be performed