EECS 482 Introduction to Operating Systems

Similar documents
I/O and file systems. Dealing with device heterogeneity

EECS 482 Introduction to Operating Systems

Operating Systems. Operating Systems Professor Sina Meraji U of T

EECS 482 Introduction to Operating Systems

Lecture S3: File system data layout, naming

Disk Scheduling COMPSCI 386

Disc Allocation and Disc Arm Scheduling?

File system internals Tanenbaum, Chapter 4. COMP3231 Operating Systems

Main Points. File layout Directory layout

Lecture 16: Storage Devices

File system internals Tanenbaum, Chapter 4. COMP3231 Operating Systems

EECS 482 Introduction to Operating Systems

CSE 451: Operating Systems Spring Module 12 Secondary Storage

CSE 451: Operating Systems Spring Module 12 Secondary Storage. Steve Gribble

Operating Systems. File Systems. Thomas Ropars.

File System Management

File Systems: Fundamentals

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

File Systems: Fundamentals

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

Segmentation with Paging. Review. Segmentation with Page (MULTICS) Segmentation with Page (MULTICS) Segmentation with Page (MULTICS)

[537] Fast File System. Tyler Harter

Today: Secondary Storage! Typical Disk Parameters!

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

CS 318 Principles of Operating Systems

CS3600 SYSTEMS AND NETWORKS

CS 537 Fall 2017 Review Session

FILE SYSTEMS. CS124 Operating Systems Winter , Lecture 23

File Systems. Chapter 11, 13 OSPP

CS420: Operating Systems. Mass Storage Structure

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

File Systems. CS 4410 Operating Systems. [R. Agarwal, L. Alvisi, A. Bracy, M. George, E. Sirer, R. Van Renesse]

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

CSE 120: Principles of Operating Systems. Lecture 10. File Systems. November 6, Prof. Joe Pasquale

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

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

EECS 482 Introduction to Operating Systems

Disks and RAID. CS 4410 Operating Systems. [R. Agarwal, L. Alvisi, A. Bracy, E. Sirer, R. Van Renesse]

Filesystem. Disclaimer: some slides are adopted from book authors slides with permission 1

File System Implementation. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

CSE 120 Principles of Operating Systems

Long-term Information Storage Must store large amounts of data Information stored must survive the termination of the process using it Multiple proces

Secondary storage. CS 537 Lecture 11 Secondary Storage. Disk trends. Another trip down memory lane

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

Chapter 14: File-System Implementation

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

What is a file system

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

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

File Systems. ECE 650 Systems Programming & Engineering Duke University, Spring 2018

CHAPTER 11: IMPLEMENTING FILE SYSTEMS (COMPACT) By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

CS153: Final Review1. Chengyu Song. Slides modified from Harsha Madhyvasta, Nael Abu-Ghazaleh, and Zhiyun Qian

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

Hard Disk Drives (HDDs) Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

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

COMP 3361: Operating Systems 1 Final Exam Winter 2009

Operating Systems. Lecture File system implementation. Master of Computer Science PUF - Hồ Chí Minh 2016/2017

Chapter 6: File Systems

CS 318 Principles of Operating Systems

CSE 153 Design of Operating Systems Fall 2018

Main Points. File systems. Storage hardware characteristics. File system usage patterns. Useful abstractions on top of physical devices

Hard Disk Drives (HDDs)

FFS: The Fast File System -and- The Magical World of SSDs

File System Implementation

Department of Computer Engineering University of California at Santa Cruz. File Systems. Hai Tao

Introduction to I/O and Disk Management

PERSISTENCE: FSCK, JOURNALING. Shivaram Venkataraman CS 537, Spring 2019

STORAGE SYSTEMS. Operating Systems 2015 Spring by Euiseong Seo

Introduction to I/O and Disk Management

CS 4284 Systems Capstone

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

CSC369 Lecture 9. Larry Zhang, November 16, 2015

Storage. CS 3410 Computer System Organization & Programming

Free Space Management

Disks & Files. Yanlei Diao UMass Amherst. Slides Courtesy of R. Ramakrishnan and J. Gehrke

Parser. Select R.text from Report R, Weather W where W.image.rain() and W.city = R.city and W.date = R.date and R.text.

COMP 530: Operating Systems File Systems: Fundamentals

Chapter 11: Implementing File Systems

Da-Wei Chang CSIE.NCKU. Professor Hao-Ren Ke, National Chiao Tung University Professor Hsung-Pin Chang, National Chung Hsing University

Final Review. Geoffrey M. Voelker. Final mechanics Memory management Paging Page replacement Disk I/O File systems Advanced topics

Block Device Scheduling. Don Porter CSE 506

Block Device Scheduling

File Layout and Directories

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

File Directories Associated with any file management system and collection of files is a file directories The directory contains information about

we are here Page 1 Recall: How do we Hide I/O Latency? I/O & Storage Layers Recall: C Low level I/O

Mass-Storage Structure

Chapter 12: File System Implementation

CS3600 SYSTEMS AND NETWORKS

Chapter 12: File System Implementation

L7: Performance. Frans Kaashoek Spring 2013

19 File Structure, Disk Scheduling

ECE 650 Systems Programming & Engineering. Spring 2018

File Systems. Before We Begin. So Far, We Have Considered. Motivation for File Systems. CSE 120: Principles of Operating Systems.

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

u Covered: l Management of CPU & concurrency l Management of main memory & virtual memory u Currently --- Management of I/O devices

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

File Systems. CS170 Fall 2018

V. Mass Storage Systems

CS 4284 Systems Capstone

Transcription:

EECS 482 Introduction to Operating Systems Winter 2018 Baris Kasikci Slides by: Harsha V. Madhyastha

OS Abstractions Applications Threads File system Virtual memory Operating System Next few lectures: CPU Hardware Disk RAM What interface does file system export to apps? How does file system interact with hardware?

Reality vs. Abstraction Hardware interface Heterogenous One/few storage objects (disk) Simple naming (Numeric, Flat, Separate) Fixed block assignment Slow Possible inconsistency on system crash OS Abstraction Uniform Many storage objects (files) Rich naming (Symbolic, Structured, Unified) Flexible block assignment Fast Crash consistency

Dealing with heterogeneity Problem: Wide range of disk types and interfaces How to manage this diversity? Solution: Add device-driver abstraction inside OS rest of OS and application programs virtual machine interface Yet device another drivers example of the power of abstractions! physical machine interface hardware Hide differences among different brands and interfaces Minimize differences between similar types of devices

Physical Disk Structure Disk components Platters Tracks Sectors Heads

Disk Performance What does disk performance depend upon? Queue wait for the disk to be free Positioning move the disk arm to the correct track and rotate to the right sector (seek & rotate) Access transfer data from/to disk For given load, performance depends on Positioning overhead (~ 1-10ms) Transfer time (~ 100MBps)

Optimizing I/O performance To increase performance of slow I/O devices: Avoid doing I/O Reduce overhead Amortize overhead over larger request Efficiency = transfer time / (positioning time + transfer time) Rule of thumb: Achieve at least 50% efficiency Example: 5ms avg. seek time and 100MBps transfer rate à Read at least 500KB

Disk scheduling Reduce overhead by reordering requests Can be implemented in OS or hardware (Tradeoffs?) Examples: FCFS (first come, first served) SSTF (shortest seek time first) SCAN (sort requests by position) How else can OS reduce overhead in disk I/O? Pros and cons? SSTF can lead to starvation, longer track travel distances Does CPU scheduling policy affect throughput? Not much for workloads where I/O matters What about queuing delays? Better scheduling also drains the queue faster

Optimizing data layout Keep related items together on disk How to know what items will be accessed together? Based on general usage patterns Based on past accesses of data

Flash RAM Optimizations depend on specifics of a device Flash RAM has different characteristics than magnetic disk Better read performance (but still slow writes)» Random read: 25μs, Sequential read: 30ns Lower power Better shock resistance But also has some issues: wearout, no overwrite OS hides physical characteristics of device from applications

Optimizing I/O performance with Flash RAM Move data blocks to do wear leveling Write data in big blocks Prefer to read data rather than write Caching is important

File systems File system: a data structure stored on a persistent medium Ensures that data persists across Power outages Machine crashes/reboots Process births/deaths How to enable persistence across these events? Use persistent storage medium Write data carefully Avoid use of addresses that change across processes

Interface to file system Create file Delete file Read <file, offset> Write <file, offset> Other (e.g., list files in a directory) Alternate interface? SQL à Database

File system workloads Optimize data structure for the common case Some general rules of thumb Most file accesses are reads Most programs access files sequentially and entirely Most files are small, but most bytes belong to large files

File abstraction Reality: One (or a few) disks to store data Abstraction: Numerous storage objects (files) Challenges: How to name files? How to find and organize files?

How to store a file? Need to store metadata File size Owner/Permissions Time of creation/last access Need to store pointer to data Pointer must be independent of process Basic data structure: a file header inode in Unix, Master File Table record in NTFS Structure that describes file and allows you to find data

Administrivia Handing back regrade requests Project 3 due in 9 days Remember to spread the commits

Contiguous allocation File = array of blocks ( extent ) Reserve space in advance If file grows, move it to a larger free area File header contains starting location of file and size Pros and cons? + Fast sequential access + Easy random access - Wastes space; external fragmentation - Difficult to grow file

Indexed files File = array of block pointers Just like page table File block # Disk block # Pros and cons? + Easy to grow file + Easy random access - But potentially slow for sequential access How to speed up sequential access? 0 18 1 50 2 8 3 15 To grow file, allocate new block close to previous block Close could be same or nearby track/cylinder Leave some free blocks to facilitate this

Indexed files Consequence of allowing for large files? Large files are OK, small files are the problem Waste space in file header for small files e.g. max file size = 16GB, file block = 4KB 4M pointers in header 160GB of headers Solution: increase block size to 4MB? Problem: internal fragmentation Trade-off between page table size and block size File block # Disk block # 0 18 1 50 2 8 3 15 4194304 189

Multi-level indexed files File = tree of block pointers level 1 node level 2 node Pros? File block # Disk block # 0 18 1 50 2 8 3 15 File block # Disk block # 4 20 5 11 6 3 7 43 Files can easily grow, appending to files is easy Allows large file, but small files don t waste header space

Multi-level indexed files Downsides? Could have lots of seeks for sequential access à Bad performance, especially for large files How to fix? Caching Non-uniform depth