CS703 - Advanced Operating Systems

Slides:



Advertisements
Similar presentations
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Disks and RAID.
Advertisements

CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
1 File Systems Chapter Files 6.2 Directories 6.3 File system implementation 6.4 Example file systems.
Lecture 17 I/O Optimization. Disk Organization Tracks: concentric rings around disk surface Sectors: arc of track, minimum unit of transfer Cylinder:
File System Implementation
Disk Drivers May 10, 2000 Instructor: Gary Kimura.
CS 104 Introduction to Computer Science and Graphics Problems Operating Systems (4) File Management & Input/Out Systems 10/14/2008 Yang Song (Prepared.
CS 333 Introduction to Operating Systems Class 18 - File System Performance Jonathan Walpole Computer Science Portland State University.
1 Outline File Systems Implementation How disks work How to organize data (files) on disks Data structures Placement of files on disk.
Disks.
Secondary Storage Management Hank Levy. 8/7/20152 Secondary Storage • Secondary Storage is usually: –anything outside of “primary memory” –storage that.
Disk and I/O Management
CS 153 Design of Operating Systems Spring 2015 Lecture 20: File Systems.
File Implementation. File System Abstraction How to Organize Files on Disk Goals: –Maximize sequential performance –Easy random access to file –Easy.
Disk Access. DISK STRUCTURE Sector: Smallest unit of data transfer from/to disk; 512B 2/4/8 adjacent sectors transferred together: Blocks Read/write heads.
IT 344: Operating Systems Winter 2010 Module 13 Secondary Storage Chia-Chi Teng CTB 265.
Disk Structure Disk drives are addressed as large one- dimensional arrays of logical blocks, where the logical block is the smallest unit of transfer.
Disks and Storage Systems
1Fall 2008, Chapter 12 Disk Hardware Arm can move in and out Read / write head can access a ring of data as the disk rotates Disk consists of one or more.
CE Operating Systems Lecture 20 Disk I/O. Overview of lecture In this lecture we will look at: Disk Structure Disk Scheduling Disk Management Swap-Space.
Lecture 3 Page 1 CS 111 Online Disk Drives An especially important and complex form of I/O device Still the primary method of providing stable storage.
CS333 Intro to Operating Systems Jonathan Walpole.
12/18/20151 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam.
1.  Disk Structure Disk Structure  Disk Scheduling Disk Scheduling  FCFS FCFS  SSTF SSTF  SCAN SCAN  C-SCAN C-SCAN  C-LOOK C-LOOK  Selecting a.
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]
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 13 Mass-Storage Systems Slide 1 Chapter 13 Mass-Storage Systems.
M ASS S TORAGE S TRUCTURES Lecture: Operating System Concepts Lecturer: Pooja Sharma Computer Science Department, Punjabi University, Patiala.
File System Performance CSE451 Andrew Whitaker. Ways to Improve Performance Access the disk less  Caching! Be smarter about accessing the disk  Turn.
CSE 451: Operating Systems Spring 2006 Module 14 From Physical to Logical: File Systems John Zahorjan Allen Center 534.
CSE 451: Operating Systems Spring 2010 Module 12.5 Secondary Storage John Zahorjan Allen Center 534.
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Chapter 11: File System Implementation.
CS522 Advanced database Systems
Operating System (013022) Dr. H. Iwidat
Jonathan Walpole Computer Science Portland State University
FileSystems.
Disks and RAID.
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Secondary Storage Secondary storage typically: Characteristics:
Operating Systems (CS 340 D)
Operating System I/O System Monday, August 11, 2008.
Disk Scheduling Algorithms
Mass-Storage Structure
IT 344: Operating Systems Winter 2008 Module 13 Secondary Storage
Lecture 45 Syed Mansoor Sarwar
Filesystems 2 Adapted from slides of Hank Levy
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
CSE 451: Operating Systems Winter 2006 Module 13 Secondary Storage
Overview Continuation from Monday (File system implementation)
CSE 451: Operating Systems Autumn 2003 Lecture 12 Secondary Storage
CSE 451: Operating Systems Winter 2007 Module 13 Secondary Storage
Printed on Monday, December 31, 2018 at 2:03 PM.
CSE 451: Operating Systems Spring 2006 Module 13 Secondary Storage
Disks and scheduling algorithms
Secondary Storage Management Brian Bershad
Persistence: hard disk drive
CSE 451: Operating Systems Secondary Storage
CSE 451: Operating Systems Winter 2003 Lecture 12 Secondary Storage
Disks and Storage Systems
CSE 451: Operating Systems Winter 2009 Module 12 Secondary Storage
CSE 451: Operating Systems Spring 2005 Module 13 Secondary Storage
Secondary Storage Management Hank Levy
CSE451 File System Introduction and Disk Drivers Autumn 2002
CSE 451: Operating Systems Autumn 2004 Secondary Storage
CSE 451: Operating Systems Winter 2004 Module 13 Secondary Storage
File System Implementation
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
CSE 451: Operating Systems Spring 2006 Module 14 From Physical to Logical: File Systems John Zahorjan Allen Center
File System Performance
CSE 451: Operating Systems Spring 2007 Module 11 Secondary Storage
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Presentation transcript:

CS703 - Advanced Operating Systems By Mr. Farhan Zaidi

Lecture No. 33

Disk Interaction Specifying disk requests requires a lot of info: Cylinder #, surface #, track #, sector #, transfer size, . . . Current disks provide a higher-level interface (SCSI) The disk exports its data as a logical array of blocks [0 … N] Disk maps logical blocks to cylinder/ surface/ track/ sector.

Some useful facts read/write single sector or adjacent groups Disk reads/writes in terms of sectors, not bytes read/write single sector or adjacent groups How to write a single byte? “Read-modify-write” read in sector containing the byte modify that byte write entire sector back to disk key: if cached, don’t need to read in Sector = unit of atomicity. sector write done completely, even if crash in middle (disk saves up enough momentum to complete) larger atomic units have to be synthesized by OS

Disk Scheduling Because seeks are so expensive (milliseconds!), the OS tries to schedule disk requests that are queued waiting for the disk FCFS (do nothing) Reasonable when load is low Long waiting times for long request queues SSTF (shortest seek time first) Minimize arm movement (seek time), maximize request rate Favors middle blocks SCAN (elevator) Service requests in one direction until done, then reverse C-SCAN Like SCAN, but only go in one direction (typewriter)

Some useful trends similar to CPU speed, memory size, etc. Disk bandwidth and cost/bit improving exponentially similar to CPU speed, memory size, etc. Seek time and rotational delay improving *very* slowly why? require moving physical object (disk arm) Some implications: disk accesses a huge system bottleneck & getting worse bandwidth increase lets system (pre-)fetch large chunks for about the same cost as small chunk. Result? Can improve performance if you can read lots of related stuff. How to get related stuff? Cluster together on disk Memory size increasing faster than typical workload size More and more of workload fits in file cache disk traffic changes: mostly writes and new data

BSD 4.4 Fast File system (FFS) Used a minimum of 4096 size disk block Records the block size in superblock Multiple file systems with different block sizes can co-reside Improves performance in several ways Superblock is replicated to provide fault tolerance

FFS Allocation Policies Allocate file inodes close to their containing directories. For mkdir, select a cylinder group with a more-than-average number of free inodes. For creat, place inode in the same group as the parent. Concentrate related file data blocks in cylinder groups. Most files are read and written sequentially. Place initial blocks of a file in the same group as its inode. How should we handle directory blocks? Place adjacent logical blocks in the same cylinder group. Logical block n+1 goes in the same group as block n. Switch to a different group for each indirect block.

Representing Small Files Internal fragmentation in the file system blocks can waste significant space for small files. FFS solution: optimize small files for space efficiency. Subdivide blocks into 2/ 4/ 8 fragments (or just frags).

Clustering in FFS Clustering improves bandwidth utilization for large files read and written sequentially. FFS can allocate contiguous runs of blocks “most of the time” on disks with sufficient free space.

FFS consistency and recovery Reconstructs free list and reference counts on reboot Enforces two invariants: directory names always reference valid inodes no block claimed by more than one inode Does this with three ordering rules: write newly allocated inode to disk before name entered in directory remove directory name before inode deallocated write deallocated inode to disk before its blocks are placed on free list File creation and deletion take 2 synchronous writes Why does FFS need third rule? Inode recovery

FFS: inode recovery New twist: FFS can find lost inodes Files can be lost if directory destroyed or crash happens before link can be set New twist: FFS can find lost inodes Facts: FFS pre-allocates inodes in known locations on disk Free inodes are initialized to all 0s. So? Fact 1 lets FFS find all inodes (whether or not there are any pointers to them) Fact 2 tells FFS that any inode with non-zero contents is (probably) still in use. fsck places unreferenced inodes with non-zero contents in the lost+found directory