ECE 5730 Memory Systems

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

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

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

Operating Systems. Operating Systems Professor Sina Meraji U of T

CSC369 Lecture 9. Larry Zhang, November 16, 2015

Chapter 11. I/O Management and Disk Scheduling

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

Hard Disk Drives (HDDs)

CS3600 SYSTEMS AND NETWORKS

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

CS420: Operating Systems. Mass Storage Structure

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

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

ECE 5730 Memory Systems

STORAGE SYSTEMS. Operating Systems 2015 Spring by Euiseong Seo

CSE 153 Design of Operating Systems

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

Final Exam Preparation Questions

CSE 153 Design of Operating Systems Fall 2018

Disk Scheduling COMPSCI 386

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

V. Mass Storage Systems

Overview of Mass Storage Structure

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

Free Space Management

Chapter 10: Mass-Storage Systems

Chapter 11. I/O Management and Disk Scheduling

COMP 3361: Operating Systems 1 Final Exam Winter 2009

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

(c) Why does the Shortest Positioning Time First (SPTF) scheduling algorithm typically outperform

Today: Secondary Storage! Typical Disk Parameters!

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

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

STORING DATA: DISK AND FILES

Operating Systems Comprehensive Exam. Spring Student ID # 3/16/2006

Adapted from instructor s supplementary material from Computer. Patterson & Hennessy, 2008, MK]

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

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

Distributed Deadlock Detection

Mass-Storage Structure

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

6.033 Computer System Engineering

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

3/3/2014! Anthony D. Joseph!!CS162! UCB Spring 2014!

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

Virtual Memory. Chapter 8

Chapter-6. SUBJECT:- Operating System TOPICS:- I/O Management. Created by : - Sanjay Patel

Announcements. Final Exam. December 10th, Thursday Patrick Taylor Hall. Chapters included in Final. 8.

CS-245 Database System Principles

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

Virtual Memory. Reading. Sections 5.4, 5.5, 5.6, 5.8, 5.10 (2) Lecture notes from MKP and S. Yalamanchili

Chapter 11: Storage and File Structure. Silberschatz, Korth and Sudarshan Updated by Bird and Tanin

20-EECE-4029 Operating Systems Spring, 2013 John Franco

Computer Architecture and Engineering CS152 Quiz #2 March 7th, 2016 Professor George Michelogiannakis Name: <ANSWER KEY>

CPSC 421 Database Management Systems. Lecture 11: Storage and File Organization

Introduction to I/O and Disk Management

Chapter 10: Mass-Storage Systems

Disks October 22 nd, 2010

Disk Scheduling. Based on the slides supporting the text

Introduction to I/O and Disk Management

CS 550 Operating Systems Spring File System

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

1993 Paper 3 Question 6

Question Points Score Total 100

CS370 Operating Systems

Introduction. Secondary Storage. File concept. File attributes

CS370 Operating Systems

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

CSE 141 Computer Architecture Spring Lectures 17 Virtual Memory. Announcements Office Hour

CSE506: Operating Systems CSE 506: Operating Systems

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

ECE7995 Caching and Prefetching Techniques in Computer Systems. Lecture 8: Buffer Cache in Main Memory (I)

A Disk Head Scheduling Simulator

Computer Architecture and System Software Lecture 09: Memory Hierarchy. Instructor: Rob Bergen Applied Computer Science University of Winnipeg

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

Disks: Structure and Scheduling

OPERATING SYSTEMS CS3502 Spring Input/Output System Chapter 9

Lecture 16: Storage Devices

CS 537 Fall 2017 Review Session

Chapter 10: Mass-Storage Systems

EECS 482 Introduction to Operating Systems

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

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

b. How many bits are there in the physical address?

File system internals Tanenbaum, Chapter 4. COMP3231 Operating Systems

I/O CANNOT BE IGNORED

Chapter 14: Mass-Storage Systems. Disk Structure

Name: Instructions. Problem 1 : Short answer. [56 points] CMU Storage Systems 25 Feb 2009 Spring 2009 Exam 1

Fall COMP3511 Review

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

EIDE, ATA, SATA, USB,

I/O Management and Disk Scheduling. Chapter 11

Computer Architecture and Engineering. CS152 Quiz #3. March 18th, Professor Krste Asanovic. Name:

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

IMPORTANT: Circle the last two letters of your class account:

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

CMU Storage Systems 20 Feb 2004 Fall 2005 Exam 1. Name: SOLUTIONS

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

CSE 421/521 - Operating Systems Fall Lecture - XXV. Final Review. University at Buffalo

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

Transcription:

ECE 5730 Memory Systems Spring 2009 Command Scheduling Disk Caching Lecture 23: 1

Announcements Quiz 12 I ll give credit for #4 if you answered (d) Quiz 13 (last one!) on Tuesday Make-up class #2 Thursday, April 30, 6:00-7:15pm, PH 403 Pizza and soda Exam II May 7, 7:00-10:00pm, Hollister 314 Covers material from 3/10-4/28 but excluding 4/22 (Lectures 14-21, 23-24) Lecture 23: 2

Course Project Last status report due tomorrow by 5pm EDT Final report (15-25 double-spaced pages) Email Word or PDF to me by 11:59pm on May 1 20 points off final project grade if late Lecture 23: 3

Final Report Organization Introduction and motivation What is the problem you are addressing? Why is it important? Proposed solution How are you proposing to solve the problem? Simulation methodology What tools are you using to evaluate your solution, and what assumptions are you making? Results How well does the solution work? What performance and/or power benefits do you get? Conclusions and future work Briefly summarize your work and suggest ways to extend it Lecture 23: 4

Command Queuing and Scheduling Historically, I/O cmds were processed serially Host waits for cmd to complete, then issues next one ATA drives operate this way Newer drives queue and schedule cmds Host sends series of cmds, each with a tag ID Drive determines best order to process the cmds Order is continually evaluated as cmds issue and arrive Drive sends tag ID back to host when cmd completes Lecture 23: 5

Cmd Queue Depth Specified by the interface standard 32 for SATA, 256 for SCSI As with processor issue queues, performance drops off beyond a certain queue depth Diminishing theoretical performance improvement as queue size increases Higher latency to evaluate a deeper queue Lecture 23: 6

Scheduling Policies First-come-first-served Seek-time-based scheduling Total-access-time-based scheduling Sequential access scheduling Lecture 23: 7

Seek-Time-Based Scheduling Policies Seeks to reduce the seek time by reducing the seek distance Shortest-Seek-Time-First (SSTF) Greedily selects the cmd with the shortest seek distance from the current position Tends to favor addresses near the middle of the disk ID and OD requests prone to starvation Can be implemented with an aging mechanism that raises the priority of older cmds Lecture 23: 8

Seek-Time-Based Scheduling Policies LOOK Start at OD, do SSTF in radial direction (OD ID) When radially innermost cmd completed, switch direction (ID OD) Queued cmds complete in < 1 sweep Favors addresses near middle (visited twice/sweep) Circular-LOOK (C-LOOK) Moves in only one radial direction More fair, but incurs a long seek after a sweep Lecture 23: 9

Shortest-Access-Time-First Scheduling Seek-time scheduling ignores rotational delay sweep direction current position seek-time scheduling [21.5] Lecture 23: 10

Shortest-Access-Time-First Scheduling Scheduling based on seek + rotational delays current position SATF scheduling [21.5] Lecture 23: 11

SATF Scheduling Incoming cmd LBA translated to CHS address Cylinder = radial position (r) Sector = angular position ( ) Cmd total access time estimated based on CHS and estimated ending position of current cmd Cmd with smallest total access time is issued Lecture 23: 12

Estimating Access Time Seek distance calculated as r new - r current beginning radial position of new cmd ending radial position of current cmd Seek table of seek time, seek distance pairs few table entries many table entries use linear interpolation for in-between points add a fixed settle time [19.6] Lecture 23: 13

Estimating Access Time Rotation time calculated from difference in angular positions before the seek Seek and rotation occur in parallel! If t seek < t rotation t access = t rotation Else t access = t rotation + n t revolution where n satisfies t seek < t rotation + n t revolution time for a complete disk revolution Lecture 23: 14

Simplified Sorting Using an RPO Table Time to compute and sort all cmds may exceed current cmd completion time Simplification Divide angular positions into N groups Each cmd placed into appropriate group based on difference in angular position from current cmd Example: 1000, sectors/track, N=10 Group 1: 0 angular difference for sectors 1-100 Group 2: 36 angular difference for sectors 101-200 (Slightly different than book to ease explanation) Lecture 23: 15

Simplified Sorting Using an RPO Table Rotational Position Optimization (RPO) table lists for each angular difference group Max seek distance given the rotational latency corresponding to the angular difference Max seek distance given the rotational latency corresponding to the angular difference plus 1 full revolution Max seek distance given the rotational latency corresponding to the angular difference plus 2 full revolutions continues up to the max seek distance Lecture 23: 16

RPO Table Example d seekrl d seekrl+1rev d seekrl+2rev 0 36 72 108 144 180 216 252 288 324 [18.7,21.6] Lecture 23: 17

Algorithm (for this RPO Table) Starting with 72 and moving down, find a non-empty group 0 36 d seekrl d seekrl+1rev d seekrl+2rev If cmd in that group has d seek < d seekrl, issue that cmd 72 108 144 Else, move to next non-empty group Then move to 0, col 2 and work downward Then move to 0, col 3 and work downward 180 216 252 288 324 [21.6] Lecture 23: 18

Sequential Access Scheduling Independent of the scheduling policy, schedule all sequential, near sequential, and skip sequential cmds back-to-back Immediately schedule newly arriving cmd that is sequential to the current cmd Handling skip sequential cmds Reads: Not requested data is simply discarded Writes: Skip mask tells the write electronics which sectors not to overwrite Lecture 23: 19

Performance Comparison 5.75ms avg seek, 1000 SPT at OD, 10K rpm Random reads of 1KB [21.7] Lecture 23: 20

Disk Drive Cache Disk drives have a built-in cache in addition to read and write buffers implemented in DRAM Typical cache size ranges from 512KB-64MB Typically only 0.01% of the drive The disk cache has a logical organization and management policies Lecture 23: 21

Why a Disk Drive Cache? A read disk cache hit avoids seek, rotation, and media transfer times Example: 0.15ms for 4K cache hit, 100MB/s interface Read access time = 0.15 + 0.04 = 0.19ms Compared to 4.885-7.885ms Read data can be prefetched from the disk Cached write data can be Served to subsequent reads Overwritten by later writes to same LBA Prioritized lower than reads in accessing disk Lecture 23: 22

Fixed Segmentation Disk Cache Most common disk cache architecture Cache space divided into fixed-size segments Number of segments may be fixed or set by the host (e.g., SCSI) Segment table holds LBA + dirty bit for each segment Fully associative lookup and LRU replacement Internal fragmentation for small blocks [22.2] Lecture 23: 23

Circular Buffer Variable size segments organized as a ring Segment size matches request Need to search for a contiguous group of data to fit the requested segment Segment table contains LBA, dirty bit, starting cache address, and segment length [22.3] Lecture 23: 24

Virtual Memory Disk Cache Organization Cache partitioned into N pages of 2 M disk sectors each Smaller M allows better space efficiency but higher management overhead Example: M=5, sector size is 512B 16KB pages LBA Partitioning sector number Physically non-contiguous cache pages can be chained to form a logically contiguous segment Eases finding space for a new segment [22.4] Lecture 23: 25

Page Table Page table maps LBAs to physical pages Each entry corresponds to a page and contains Tag of LBAs associated with this page Valid and dirty bits for the 2 M sectors of the page Hash chain pointer to chain all the allocation groups that shared this hash number Lecture 23: 26

Cache Lookup [22.5] Lecture 23: 27

Page Allocation/Deallocation Pages arranged in replacement list, e.g., LRU Dirty flag marks write pages To allocate X pages for a new segment, deallocate first X clean pages on the list Deallocate LRU dirty pages if necessary Lecture 23: 28

Cache Prefetching Data can be prefetched from the drive and placed into the cache for subsequent cmds Prefetching is not initiated unless the cmd queue is empty Prefetching may be pre-empted by a newly arriving cmd (unless it s a cache hit) Prefetched data with errors may be discarded Lecture 23: 29

Lookahead Prefetching Read B additional sequential LBAs beyond the requested read access No seek or RL overhead, but requires cache space Implemented in all disk drives Lecture 23: 30

Look-behind Prefetching Read data before the requested read access Only read the amount permitted by the rotational latency, up to a maximum limit [22.6] Lecture 23: 31

Zero Latency Prefetch Reduces rotational overhead when head lands in lookahead area normal prefetch zero latency prefetch Lecture 23: 32

Sequential Data and Prefetching Controller may modify it policies if it recognizes a sequential stream of read cmds, e.g., If a newly arriving request is to the LBA currently being prefetched, immediately prefetch more data Do not pre-empt current prefetch due to new cmd, but instead prefetch some minimum amount of data Amount may be adaptively determined by the controller Quickly reallocate the cache space of the sequential stream rather than displace other data Lecture 23: 33

Next Time Disk Power Management RAID Lecture 23: 34