CSE 153 Design of Operating Systems Fall 2018

Similar documents
CSE 153 Design of Operating Systems

CS 201 The Memory Hierarchy. Gerson Robboy Portland State University

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 26, SPRING 2013

Storage Technologies and the Memory Hierarchy

CS 33. Memory Hierarchy I. CS33 Intro to Computer Systems XVI 1 Copyright 2016 Thomas W. Doeppner. All rights reserved.

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 26, FALL 2012

Foundations of Computer Systems

Computer Organization: A Programmer's Perspective

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

Giving credit where credit is due

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

CS429: Computer Organization and Architecture

CS429: Computer Organization and Architecture

Computer Systems. Memory Hierarchy. Han, Hwansoo

CISC 360. The Memory Hierarchy Nov 13, 2008

Random Access Memory (RAM)

Random-Access Memory (RAM) Lecture 13 The Memory Hierarchy. Conventional DRAM Organization. SRAM vs DRAM Summary. Topics. d x w DRAM: Key features

Key features. ! RAM is packaged as a chip.! Basic storage unit is a cell (one bit per cell).! Multiple RAM chips form a memory.

STORAGE SYSTEMS. Operating Systems 2015 Spring by Euiseong Seo

The Memory Hierarchy /18-213/15-513: Introduction to Computer Systems 11 th Lecture, October 3, Today s Instructor: Phil Gibbons

The Memory Hierarchy Sept 29, 2006

Ref: Chap 12. Secondary Storage and I/O Systems. Applied Operating System Concepts 12.1

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

Hard Disk Drives (HDDs)

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

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

Module 1: Basics and Background Lecture 4: Memory and Disk Accesses. The Lecture Contains: Memory organisation. Memory hierarchy. Disks.

CSE 451: Operating Systems Spring Module 12 Secondary Storage

Random-Access Memory (RAM) CS429: Computer Organization and Architecture. SRAM and DRAM. Flash / RAM Summary. Storage Technologies

NEXT SET OF SLIDES FROM DENNIS FREY S FALL 2011 CMSC313.

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

Random-Access Memory (RAM) CISC 360. The Memory Hierarchy Nov 24, Conventional DRAM Organization. SRAM vs DRAM Summary.

The Memory Hierarchy / : Introduction to Computer Systems 10 th Lecture, Feb 12, 2015

Today. The Memory Hierarchy. Random-Access Memory (RAM) Nonvolatile Memories. Traditional Bus Structure Connecting CPU and Memory

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

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

COS 318: Operating Systems. Storage Devices. Vivek Pai Computer Science Department Princeton University

UNIT 2 Data Center Environment

Today. The Memory Hierarchy. Byte Oriented Memory Organization. Simple Memory Addressing Modes

Input/Output. Today. Next. Principles of I/O hardware & software I/O software layers Secondary storage. File systems

CSE 120 Principles of Operating Systems

CS420: Operating Systems. Mass Storage Structure

Input/Output. Chapter 5: I/O Systems. How fast is I/O hardware? Device controllers. Memory-mapped I/O. How is memory-mapped I/O done?

Operating Systems. Operating Systems Professor Sina Meraji U of T

CS 2461: Computer Architecture 1 The Memory Hierarchy and impact on program performance

Hard Disk Drives. Nima Honarmand (Based on slides by Prof. Andrea Arpaci-Dusseau)

COS 318: Operating Systems. Storage Devices. Kai Li Computer Science Department Princeton University

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

EECS 482 Introduction to Operating Systems

The Memory Hierarchy 10/25/16

CSE 120. Operating Systems. March 27, 2014 Lecture 17. Mass Storage. Instructor: Neil Rhodes. Wednesday, March 26, 14

COS 318: Operating Systems. Storage Devices. Jaswinder Pal Singh Computer Science Department Princeton University

Disks October 22 nd, 2010

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

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

Chapter 11. I/O Management and Disk Scheduling

CSCI-UA.0201 Computer Systems Organization Memory Hierarchy

CS3600 SYSTEMS AND NETWORKS

CSE506: Operating Systems CSE 506: Operating Systems

[537] I/O Devices/Disks. Tyler Harter

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

The. Memory Hierarchy. Chapter 6

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

Computer Science 61C Spring Friedland and Weaver. Input/Output

Anatomy of a disk. Stack of magnetic platters. Disk arm assembly

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

Input/Output. Today. Next. Principles of I/O hardware & software I/O software layers Disks. Protection & Security

Introduction to I/O and Disk Management

Introduction to I/O and Disk Management

Disk Scheduling COMPSCI 386

I/O 1. Devices and I/O. key concepts device registers, device drivers, program-controlled I/O, DMA, polling, disk drives, disk head scheduling

Lecture 16: Storage Devices

CSE 120 Principles of Operating Systems

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

Storage. CS 3410 Computer System Organization & Programming

Giving credit where credit is due

Disks March 15, 2010

Carnegie Mellon. Carnegie Mellon

Data Storage and Query Answering. Data Storage and Disk Structure (2)

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

Today: Secondary Storage! Typical Disk Parameters!

CPS104 Computer Organization and Programming Lecture 18: Input-Output. Outline of Today s Lecture. The Big Picture: Where are We Now?

CSC369 Lecture 9. Larry Zhang, November 16, 2015

CSE 120. Overview. July 27, Day 8 Input/Output. Instructor: Neil Rhodes. Hardware. Hardware. Hardware

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

37. Hard Disk Drives. Operating System: Three Easy Pieces

Operating Systems Peter Pietzuch

Outline. Operating Systems: Devices and I/O p. 1/18

Lecture 29. Friday, March 23 CS 470 Operating Systems - Lecture 29 1

UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Computer Architecture ECE 568

A Computer. Computer organization - Recap. The Memory Hierarchy... Brief Overview of Memory Design. CPU has two components: Memory

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

Announcements. Outline

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

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

I/O Management and Disk Scheduling. Chapter 11

CS 31: Intro to Systems Storage and Memory. Kevin Webb Swarthmore College March 17, 2015

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

Block Device Scheduling. Don Porter CSE 506

Block Device Scheduling

Transcription:

CSE 153 Design of Operating Systems Fall 2018 Lecture 12: File Systems (1) Disk drives

OS Abstractions Applications Process File system Virtual memory Operating System CPU Hardware Disk RAM CSE 153 Lecture 12 File Systems 2

File Systems Agenda First we ll discuss properties of physical disks Structure, Performance Scheduling Then we ll discuss how to build file systems (next time) Abstraction:» Files» Directories» Sharing» Protection Implementation» File System Layouts» File Buffer Cache» Read Ahead CSE 153 Lecture 12 File Systems 3

Disks and the OS Disks are messy physical devices: Errors, bad blocks, missed seeks, etc. OS s job is to hide this mess from higher level software Low-level device control (initiate a disk read, etc.) Os provides Higher-level abstractions (files, databases, etc.) OS maps them to the device and implements policies to promote» Performance, reliability, protection, CSE 153 Lecture 12 File Systems 4

What s Inside A Disk Drive? Arm Spindle Platters Actuator SCSI connector Electronics (including a processor and memory!) CSE 153 Lecture 12 File Systems 5 Image courtesy of Seagate Technology

Physical Disk Structure Disk components Platters Arm Surface Surfaces Tracks Sectors Cylinders Arm Heads Platter Cylinder Heads Arm Sector (512 bytes) Track CSE 153 Lecture 12 File Systems 6

Disk Geometry Disks consist of platters, each with two surfaces. Each surface consists of concentric rings called tracks. Each track consists of sectors separated by gaps. Tracks Surface Track k Gaps Spindle Sectors CSE 153 Lecture 12 File Systems 7

Disk Geometry (Muliple- Platter View) Aligned tracks form a cylinder. Cylinder k Surface 0 Surface 1 Surface 2 Surface 3 Surface 4 Surface 5 Platter 0 Platter 1 Platter 2 Spindle CSE 153 Lecture 12 File Systems 8

spindle Disk Operation (Single-Platter View) The disk surface spins at a fixed rotational rate The read/write head is attached to the end of the arm and flies over the disk surface on a thin cushion of air. spindle spindle spindle By moving radially, the arm can position the read/write head over any track. CSE 153 Lecture 12 File Systems 11

Disk Operation (Multi-Platter View) Read/write heads move in unison from cylinder to cylinder Arm Spindle CSE 153 Lecture 12 File Systems 12

Disk Structure - top view of single platter Surface organized into tracks Tracks divided into sectors CSE 153 Lecture 12 File Systems 13

Disk Access Head in position above a track CSE 153 Lecture 12 File Systems 14

Disk Access Rotation is counter-clockwise CSE 153 Lecture 12 File Systems 15

Disk Access Read About to read blue sector CSE 153 Lecture 12 File Systems 16

Disk Access Read After BLUE read After reading blue sector CSE 153 Lecture 12 File Systems 17

Disk Access Read After BLUE read Red request scheduled next CSE 153 Lecture 12 File Systems 18

Disk Access Seek After BLUE read Seek for RED Seek to red s track CSE 153 Lecture 12 File Systems 19

Disk Access Rotational Latency After BLUE read Seek for RED Rotational latency Wait for red sector to rotate around CSE 153 Lecture 12 File Systems 20

Disk Access Read After BLUE read Seek for RED Rotational latency After RED read Complete read of red CSE 153 Lecture 12 File Systems 21

Disk Access Service Time Components After BLUE read Seek for RED Rotational latency After RED read Data transfer Seek Rotational latency Data transfer CSE 153 Lecture 12 File Systems 22

Disk Access Time Average time to access some target sector approximated by : Taccess = Tavg seek + Tavg rotation + Tavg transfer Seek time (Tavg seek) Time to position heads over cylinder containing target sector. Typical Tavg seek is 3 9 ms Rotational latency (Tavg rotation) Time waiting for first bit of target sector to pass under r/w head. Tavg rotation = 1/2 x 1/RPMs x 60 sec/1 min Typical Tavg rotation = 7200 RPMs Transfer time (Tavg transfer) Time to read the bits in the target sector. Tavg transfer = 1/RPM x 1/(avg # sectors/track) x 60 secs/1 min. CSE 153 Lecture 12 File Systems 23

Disk Access Time Example Given: Rotational rate = 7,200 RPM Average seek time = 9 ms. Avg # sectors/track = 400. Derived: Tavg rotation = 1/2 x (60 secs/7200 RPM) x 1000 ms/sec = 4 ms. Tavg transfer = 60/7200 RPM x 1/400 secs/track x 1000 ms/sec = 0.02 ms Taccess = 9 ms + 4 ms + 0.02 ms Important points: Access time dominated by seek time and rotational latency. First bit in a sector is the most expensive, the rest are free. SRAM access time is about 4 ns/doubleword, DRAM about 60 ns» Disk is about 40,000 times slower than SRAM,» 2,500 times slower then DRAM. CSE 153 Lecture 12 File Systems 24

Logical Disk Blocks Modern disks present a simpler abstract: The set of available sectors is modeled as a sequence of b- sized logical blocks (0, 1, 2,...) Mapping between logical and actual (physical) sectors Maintained by a device called disk controller. Converts requests for logical blocks into (surface,track,sector) Allows controller to set aside spare cylinders for each zone. Accounts for the difference in formatted capacity and maximum capacity. CSE 153 Lecture 12 File Systems 25

I/O and disk in the system CSE 153 Lecture 12 File Systems 26

Motherboard CSE 153 Lecture 12 File Systems 27

I/O Bus CPU chip Register file ALU System bus Memory bus Bus interface I/O bridge Main memory USB controller Graphics adapter I/O bus Disk controller Expansion slots for other devices such as network adapters. MouseKeyboard Monitor CSE 153 Lecture 12 File Systems Disk 28

Reading a Disk Sector (1) CPU chip Register file ALU CPU initiates a disk read by writing a command, logical block number, and destination memory address to a port (address) associated with disk controller. Bus interface Main memory I/O bus USB controller Graphics adapter Disk controller mouse keyboard Monitor Disk CSE 153 Lecture 12 File Systems 29

Reading a Disk Sector (2) CPU chip Register file ALU Disk controller reads the sector and performs a direct memory access (DMA) transfer into main memory. Bus interface Main memory I/O bus USB controller Graphics adapter Disk controller MouseKeyboard Monitor Disk CSE 153 Lecture 12 File Systems 30

Reading a Disk Sector (3) CPU chip Register file ALU When the DMA transfer completes, the disk controller notifies the CPU with an interrupt (i.e., asserts a special interrupt pin on the CPU) Bus interface Main memory I/O bus USB controller Graphics adapter Disk controller MouseKeyboard Monitor Disk CSE 153 Lecture 12 File Systems 31

Disks Heterogeneity Seagate Barracuda 3.5" (workstation) capacity: 250-750 GB rotational speed: 7,200 RPM sequential read performance: 78 MB/s (outer) - 44 MB/s (inner) seek time (average): 8.1 ms Seagate Cheetah 3.5" (server) capacity: 73-300 GB rotational speed: 15,000 RPM sequential read performance: 135 MB/s (outer) - 82 MB/s (inner) seek time (average): 3.8 ms Seagate Savvio 2.5" (smaller form factor) capacity: 73 GB rotational speed: 10,000 RPM sequential read performance: 62 MB/s (outer) - 42 MB/s (inner) seek time (average): 4.3 ms CSE 153 Lecture 12 File Systems 33

Recent: Seagate Enterprise (2015) 10TB! 800 Gbits/inch 2 7 (3.5 ) platters, 2 heads each 7200 RPM, 8ms seek latency 249/225 MB/sec read/write transfer rates 2.5million hours MTBF 256MB cache MSRP ~$500 CSE 153 Lecture 12 File Systems 34

Contrarian View A lot of file system ideas tied to disk drives are no CSE 153 Lecture 12 File Systems 36 longer relevant?

Disk Scheduling Because seeks are so expensive (milliseconds!), OS schedules requests that are queued waiting for the disk FCFS (do nothing)» Reasonable when load is low» Does nothing to minimize overhead of seeks SSTF (shortest seek time first)» Minimize arm movement (seek time), maximize request rate» Favors middle blocks, potential starvation of blocks at ends SCAN (elevator)» Service requests in one direction until done, then reverse» Long waiting times for blocks at ends C-SCAN» Like SCAN, but only go in one direction (typewriter) CSE 153 Lecture 12 File Systems 38

Disk Scheduling (2) In general, unless there are request queues, disk scheduling does not have much impact Important for servers, less so for PCs Modern disks often do the disk scheduling themselves Disks know their layout better than OS, can optimize better Ignores, undoes any scheduling done by OS CSE 153 Lecture 12 File Systems 39