Free Space Management

Similar documents
Overview of Mass Storage Structure

EIDE, ATA, SATA, USB,

Chapter 12: Secondary-Storage Structure. Operating System Concepts 8 th Edition,

Chapter 12: Mass-Storage Systems. Operating System Concepts 8 th Edition,

Chapter 10: Mass-Storage Systems

CS420: Operating Systems. Mass Storage Structure

CS3600 SYSTEMS AND NETWORKS

V. Mass Storage Systems

Chapter 12: Mass-Storage Systems. Operating System Concepts 8 th Edition,

Chapter 10: Mass-Storage Systems

Chapter 10: Mass-Storage Systems. Operating System Concepts 9 th Edition

CHAPTER 12: MASS-STORAGE SYSTEMS (A) By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

Mass-Storage Systems

Module 13: Secondary-Storage Structure

Disk Scheduling. Based on the slides supporting the text

CS370 Operating Systems

Disk Scheduling. Chapter 14 Based on the slides supporting the text and B.Ramamurthy s slides from Spring 2001

Chapter 12: Mass-Storage

Chapter 14: Mass-Storage Systems. Disk Structure

MASS-STORAGE STRUCTURE

CS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University

CS370 Operating Systems

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

Disc Allocation and Disc Arm Scheduling?

Overview of Mass Storage Structure

CSE325 Principles of Operating Systems. Mass-Storage Systems. David P. Duggan. April 19, 2011

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

Chapter 12: Mass-Storage Systems. Operating System Concepts 8 th Edition

Chapter 11: Mass-Storage Systems

Chapter 10: Mass-Storage Systems

Chapter 13: Mass-Storage Systems. Disk Scheduling. Disk Scheduling (Cont.) Disk Structure FCFS. Moving-Head Disk Mechanism

Chapter 13: Mass-Storage Systems. Disk Structure

CS370: Operating Systems [Spring 2017] Dept. Of Computer Science, Colorado State University

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

CS370: Operating Systems [Fall 2018] Dept. Of Computer Science, Colorado State University

Chapter 5: Input Output Management. Slides by: Ms. Shree Jaswal

CS370: Operating Systems [Fall 2018] Dept. Of Computer Science, Colorado State University

Mass-Storage Systems. Mass-Storage Systems. Disk Attachment. Disk Attachment

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

Chapter 12: Mass-Storage Systems. Operating System Concepts 9 th Edition

Chapter 14: Mass-Storage Systems

File. File System Implementation. Operations. Permissions and Data Layout. Storing and Accessing File Data. Opening a File

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

Module 13: Secondary-Storage

Chapter 12: Mass-Storage

Chapter 12: Mass-Storage

Mass-Storage Structure

Chapter 12: Mass-Storage Systems

Chapter 10: Mass-Storage Systems. Operating System Concepts 9 th Edition

UNIT 4 Device Management

UNIT-7. Overview of Mass Storage Structure

Tape pictures. CSE 30341: Operating Systems Principles

I/O, Disks, and RAID Yi Shi Fall Xi an Jiaotong University

Mass-Storage Structure

CHAPTER 12 AND 13 - MASS-STORAGE STRUCTURE & I/O- SYSTEMS

Chapter 14: Mass-Storage Systems

Silberschatz, et al. Topics based on Chapter 13

I/O Systems and Storage Devices

CS370 Operating Systems

Disk scheduling Disk reliability Tertiary storage Swap space management Linux swap space management

CSE 4/521 Introduction to Operating Systems. Lecture 27 (Final Exam Review) Summer 2018

I/O Device Controllers. I/O Systems. I/O Ports & Memory-Mapped I/O. Direct Memory Access (DMA) Operating Systems 10/20/2010. CSC 256/456 Fall

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

Chapter 7: Mass-storage structure & I/O systems. Operating System Concepts 8 th Edition,

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

Mass-Storage. ICS332 - Fall 2017 Operating Systems. Henri Casanova

File. File System Implementation. File Metadata. File System Implementation. Direct Memory Access Cont. Hardware background: Direct Memory Access

MODULE 4. FILE SYSTEM AND SECONDARY STORAGE

CSE Opera+ng System Principles

Mass Storage. 2. What are the difference between Primary storage and secondary storage devices? Primary Storage is Devices. Secondary Storage devices

EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture)

Operating Systems. No. 9 ศร ณย อ นทโกส ม Sarun Intakosum

Lecture 9. I/O Management and Disk Scheduling Algorithms

Chapter 14: File-System Implementation

Today: Secondary Storage! Typical Disk Parameters!

Part IV I/O System. Chapter 12: Mass Storage Structure

Roadmap. Tevfik Koşar. CSC Operating Systems Spring Lecture - XII Main Memory - II. Louisiana State University

Operating Systems 2010/2011

I/O Handling. ECE 650 Systems Programming & Engineering Duke University, Spring Based on Operating Systems Concepts, Silberschatz Chapter 13

Introduction Disks RAID Tertiary storage. Mass Storage. CMSC 420, York College. November 21, 2006

CSCI-GA Operating Systems. I/O : Disk Scheduling and RAID. Hubertus Franke

Chapter 14 Mass-Storage Structure

CISC 7310X. C11: Mass Storage. Hui Chen Department of Computer & Information Science CUNY Brooklyn College. 4/19/2018 CUNY Brooklyn College

File-System Structure. Allocation Methods. Free-Space Management. Directory Implementation. Efficiency and Performance. Recovery

Operating Systems. V. Input / Output. Eurecom

Principles of Operating Systems CS 446/646

Part IV I/O System Chapter 1 2: 12: Mass S torage Storage Structur Structur Fall 2010

VIII. Input/Output Operating Systems Prof. Dr. Marc H. Scholl DBIS U KN Summer Term

Devices and Device Controllers. secondary storage (disks, tape) and storage controllers

Lecture 16: Storage Devices

Mass-Storage. ICS332 Operating Systems

CSE 451: Operating Systems Winter Secondary Storage. Steve Gribble. Secondary storage

CIS Operating Systems I/O Systems & Secondary Storage. Professor Qiang Zeng Spring 2018

I/O & Storage. Jin-Soo Kim ( Computer Systems Laboratory Sungkyunkwan University

Access time based on initial head position in disk scheduling

STORAGE SYSTEMS. Operating Systems 2015 Spring by Euiseong Seo

CSE 451: Operating Systems Winter Lecture 12 Secondary Storage. Steve Gribble 323B Sieg Hall.

Operating Systems. V. Input / Output

CIS Operating Systems I/O Systems & Secondary Storage. Professor Qiang Zeng Fall 2017

Operating System 1 (ECS-501)

Transcription:

CSC 4103 - Operating Systems Spring 2007 Lecture - XVI File Systems - II Tevfik Koşar Louisiana State University March 22 nd, 2007 1 Free Space Management Disk space limited Need to re-use the space from deleted files To keep track of free disk space, the system maintains a free-space list Records all free disk blocks Implemented using Bit vectors Linked lists

Free-Space Management (Cont.) Bit vector (n blocks) Each block is represented by 1 bit 1: free, 0: allocated 0 1 2 n-1 bit[i] = 678 0 block[i] free 1 block[i] occupied Special instructions to return the offset in a word of the first bit with value 1 Block number calculation: (number of bits per word) * (number of 0-value words) + offset of first 1 bit Free-Space Management (Cont.) Bit map requires extra space Example: block size = 2 12 bytes disk size = 2 30 bytes (1 gigabyte) n = 2 30 /2 12 = 2 18 bits (or 32K bytes) Easy to get contiguous files Linked list (free list) Cannot get contiguous space easily requires substantial I/O Grouping Modification of free-list Store addresses of n free blocks in the first free block Counting Rather than keeping list of n free addresses: Keep the address of the first free block And the number n of free contiguous blocks that follow it

Overview of Mass Storage Structure Magnetic disks provide bulk of secondary storage of modern computers Drives rotate at 60 to 200 times per second Transfer rate is rate at which data flow between drive and computer Positioning time (random-access time) is time to move disk arm to desired cylinder (seek time) and time for desired sector to rotate under the disk head (rotational latency) Head crash results from disk head making contact with the disk surface That s bad Disks can be removable Drive attached to computer via I/O bus Busses vary, including EIDE, ATA, SATA, USB, Fibre Channel, SCSI Host controller in computer uses bus to talk to disk controller built into drive or storage array Moving-head Disk Machanism

Overview of Mass Storage Structure (Cont.) Magnetic tape Was early secondary-storage medium Relatively permanent and holds large quantities of data Access time slow Random access ~1000 times slower than disk Mainly used for backup, storage of infrequently-used data, transfer medium between systems Kept in spool and wound or rewound past read-write head Once data under head, transfer rates comparable to disk Hundreds of GB typical storage Common technologies are 4mm, 8mm, 19mm, LTO-2 and SDLT Disk Structure Disk drives are addressed as large 1-dimensional arrays of logical blocks, where the logical block is the smallest unit of transfer. The 1-dimensional array of logical blocks is mapped into the sectors of the disk sequentially. Sector 0 is the first sector of the first track on the outermost cylinder. Mapping proceeds in order through that track, then the rest of the tracks in that cylinder, and then through the rest of the cylinders from outermost to innermost.

Disk Scheduling The operating system is responsible for using hardware efficiently for the disk drives, this means having a fast access time and disk bandwidth. Access time has two major components Seek time is the time for the disk are to move the heads to the cylinder containing the desired sector. Rotational latency is the additional time waiting for the disk to rotate the desired sector to the disk head. Minimize seek time Seek time seek distance Disk bandwidth is the total number of bytes transferred, divided by the total time between the first request for service and the completion of the last transfer. Disk Scheduling (Cont.) Several algorithms exist to schedule the servicing of disk I/O requests. We illustrate them with a request queue (0-199). 98, 183, 37, 122, 14, 124, 65, 67 Head pointer 53

FCFS Illustration shows total head movement of 640 cylinders. SSTF SSTF: Shortest Seek Time First Algorithm Selects the request with the minimum seek time from the current head position. SSTF scheduling is a form of SJF scheduling; may cause starvation of some requests. Illustration shows total head movement of 236 cylinders.

SSTF (Cont.) SCAN The disk arm starts at one end of the disk, and moves toward the other end, servicing requests until it gets to the other end of the disk, where the head movement is reversed and servicing continues. Sometimes called the elevator algorithm. Illustration shows total head movement of 208 cylinders.

SCAN (Cont.) C-SCAN Provides a more uniform wait time than SCAN. The head moves from one end of the disk to the other. servicing requests as it goes. When it reaches the other end, however, it immediately returns to the beginning of the disk, without servicing any requests on the return trip. Treats the cylinders as a circular list that wraps around from the last cylinder to the first one.

C-SCAN (Cont.) C-LOOK Version of C-SCAN Arm only goes as far as the last request in each direction, then reverses direction immediately, without first going all the way to the end of the disk.

C-LOOK (Cont.) Selecting a Disk-Scheduling Algorithm SSTF is common since increases performance over FCF, but may cause starvation. SCAN and C-SCAN perform better for systems that place a heavy load on the disk, prevent starvation. LOOK and C-LOOK optimize SCAN and S-SCAN further. Performance depends on the number and types of requests. Requests for disk service can be influenced by the file-allocation method. The disk-scheduling algorithm should be written as a separate module of the operating system, allowing it to be replaced with a different algorithm if necessary. Either SSTF or LOOK is a reasonable choice for the default algorithm.

Any Questions? Hmm.. 21 Reading Assignment Read chapter 11 from Silberschatz. 22

Acknowledgements Operating Systems Concepts book and supplementary material by Silberschatz, Galvin and Gagne. 23