Using Hard Disks in Real-Time Systems Mark Stanovich.

Slides:



Advertisements
Similar presentations
Chapter 6 I/O Systems.
Advertisements

EE5900 Advanced Embedded System For Smart Infrastructure
IT253: Computer Organization
Disk Storage SystemsCSCE430/830 Disk Storage Systems CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Yifeng Zhu (U. Maine) Fall,
Overview of Mass Storage Structure
I/O Management and Disk Scheduling
Continuous Media 1 Differs significantly from textual and numeric data because of two fundamental characteristics: –Real-time storage and retrieval –High.
CSE506: Operating Systems Disk Scheduling. CSE506: Operating Systems Key to Disk Performance Don’t access the disk – Whenever possible Cache contents.
OPERATING SYSTEMS CS3530 Summer 2014 OPERATING SYSTEMS CS3530 Summer 2014 Input/Output System Chapter 9.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Chapter 6a: CPU Scheduling.
Day 30 I/O Management and Disk Scheduling. I/O devices Vary in many ways Vary in many ways –Data rate –Application –Complexity of control –Unit of transfer.
Input/Output Management and Disk Scheduling
University of Pennsylvania 10/24/00CSE 3801 Disk Scheduling CSE 380 Lecture Note 11a Insup Lee.
Device Management.
Introduction to Database Systems 1 The Storage Hierarchy and Magnetic Disks Storage Technology: Topic 1.
Disk and I/O Management
CS4432: Database Systems II Data Storage (Better Block Organization) 1.
Device Management. So far… We have covered CPU and memory management Computing is not interesting without I/Os Device management: the OS component that.
Topic: Disks – file system devices. Rotational Media Sector Track Cylinder Head Platter Arm Access time = seek time + rotational delay + transfer time.
Chapter 12: Mass-Storage Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 Chapter 12: Mass-Storage.
Real-Time Systems Mark Stanovich. Introduction System with timing constraints (e.g., deadlines) What makes a real-time system different? – Meeting timing.
CPU Scheduling CSCI 444/544 Operating Systems Fall 2008.
Lecture 7: Scheduling preemptive/non-preemptive scheduler CPU bursts
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.
1 Real-Time Scheduling. 2Today Operating System task scheduling –Traditional (non-real-time) scheduling –Real-time scheduling.
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.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
Device Management Mark Stanovich Operating Systems COP 4610.
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
CPSC 231 Secondary storage (D.H.)1 Learning Objectives Understanding disk organization. Sectors, clusters and extents. Fragmentation. Disk access time.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
CPU Scheduling Scheduling processes (or kernel-level threads) onto the cpu is one of the most important OS functions. The cpu is an expensive resource.
Chapter 10: Mass-Storage Systems
Multimedia Systems Operating System Presentation On
OPERATING SYSTEMS CS 3502 Fall 2017
lecture 5: CPU Scheduling
Sarah Diesburg Operating Systems CS 3430
EEE Embedded Systems Design Process in Operating Systems 서강대학교 전자공학과
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Secondary Storage Secondary storage typically: Characteristics:
Chapter 2 Scheduling.
Chapter 8 – Processor Scheduling
Scheduling (Priority Based)
Lecture 45 Syed Mansoor Sarwar
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Operating Systems (CS 340 D)
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
Lecture 21: Introduction to Process Scheduling
Operating System Concepts
CSE 451: Operating Systems Winter 2006 Module 13 Secondary Storage
CSE 451: Operating Systems Autumn 2003 Lecture 12 Secondary Storage
Chapter 6: CPU Scheduling
Persistence: hard disk drive
Chapter 6: CPU Scheduling
Chapter 11 I/O Management and Disk Scheduling
Lecture 2 Part 3 CPU Scheduling
CSE 451: Operating Systems Winter 2003 Lecture 12 Secondary Storage
Lecture 21: Introduction to Process Scheduling
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
CSE 451: Operating Systems Autumn 2004 Secondary Storage
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 6: CPU Scheduling
Operating Systems 2019 Spring by Euiseong Seo
Module 5: CPU Scheduling
Andy Wang Operating Systems COP 4610 / CGS 5765
Presentation transcript:

Using Hard Disks in Real-Time Systems Mark Stanovich

Context Real-time systems Raw disk I/O Hard disks with built-in scheduler/queue Mixed Workload Disk requests with deadline/response time requirements Background/best effort requests Want to guarantee real-time deadlines

Difficulties Real-time schedulability analysis generally relies on knowing worst-case execution times (WCET) Non-preemption makes guarantees even more difficult Variability of disk service times is extreme (tens of milliseconds to several seconds) Result is that hard disks are not prevelant in the critical path of a real-time system Meeting guarantees vs optimizing disk utilization

Value of Research Provides more information to provide schedulability analysis Large capacity of hard disks can be utilized in the critical path of a real-time system Less burden on other resources Lower latencies

Applications Multimedia Data Logging Webservers Data Analysis

Disk Scheduling Allow internal scheduler to schedule requests less burden on the CPU device driver can be at a lower priority fine-grained internal state does not have to be maintained disk specific characteristics can be utilized All scheduling performed inside the OS more control over request service order scheduling policy can be changed

Disk Scheduling Rotational-Position-Aware Real-Time Disk Scheduling Using a Dynamic Active Subset (DAS) A Real-Time Disk Scheduler for Multimedia Integrated Server Considering the Disk Internal Scheduler

Dynamic Active Subset upon each scheduling decision, the calculation of a subset of the outstanding disk requests such that all service guarantees can be enforced under worst-case assumptions schedule the subset based on the rotational position of requests in order to improve scheduling decision

Response Times

Worst-Case Execution Time seek time rotional delay * number of rotations to settle access time for some number of sectors time per sector varies depending on the zone overhead time disk controller processing data transfer between disk and host system skew time * v time to switch next cylinder and next disk head v depends on maximum request size and minimum size of a single track

Number of Rotations to Settle Rare cases the disk head needs some additional rotations to settle on the destination track Provoke worst-case by alternately issuing requests to the innermost and outermost region of the disk

Worst-Case Execution Times

Hiding Overhead Times substantial amount of time communicating with the disk without media access use TCQ to minimize these times send 2 requests so that as one request is transferred to or from the disk the other will be executing

Real-Time Disk Scheduling Execute all real-time requests at the beginning of each period limits the scope of scheduling optimizations to request classes DAS construct a subset of the outstanding requests such that no service guarantee will be violated regardless of which request is executed all scheduling algorithms can be used while ensuring deadlines dynamic nature of DAS does not allow scheduling inside the disk controller's hardware

DAS

Performance

Autonomous disk head location = data locations to retrieve

Autonomous Worst-case Rotational Latencies 5400 RPM = 11.1 msec 7200 RPM = 8.3 msec 10K RPM = 6 msec disk head location

Autonomous cons without detailed knowledge of hard disk internals, service times are difficult to predict for real-time requests

Lack of Preemption Capablility Real-time requests must wait for current request to finish if current request takes too long, even if we start the real-time request immediately, it may fail to meet its deadline NCQ does not allow requests to be pushed to the head of the queue now we may have to wait for all requests on the disk to be processed first

Response Time Simplistic Bound rotation latency + full stroke seek time Example: Maxtor 73G 10K RPM drive worst case latency: 6 msec + 11 msec = 17 msec

Response Time background task real-time task

Response Time

RT I/O Scheduler simple no merging no sorting accomodates I/O priorities VFS block I/O device driver elevator application user space kernel space

Response Times

Problems disk unaware of request priorities starvation of requests new background requests sent to the disk are serviced before older requests better performance to keep disk head in a certain region, less disk head movement

Response Times

Solutions use round based scheduling with ordered tag to prevent background requests from being serviced before real-time requests [Kim 2003] rely on disk starvation prevention algorithm draining of disk queue limiting on disk queue depth

Draining

allow disk to service request already on the disk without sending any new requests drain_time(n) maximum time to service n disk requests with no subsequent requests being sent to the disk condition to send new request: if (current time + drain_time(x)) <= earliest deadline, where x is the size of the on-disk queue depth

Draining determing drain_time(n) on-disk scheduling logic unknown, therefore makes analytical analysis difficult can empirically determine send n number of requests to the disk and measure the time to completion how to know when the worst case response time has been reached

Draining

Limiting On-Disk Queue Depth max_depth maximum number of outstanding requests permitted to be sent to the disk condition to send new request: if number of outstanding requests < max_depth

Implementation VFS block I/O device driver elevator application user space kernel space

Experimental Verification periodic real-time task requests data from disk period = deadline = 250 msec 256KB request size 450 constant background asynchronous requests sent to same disk

Experimental Verification

Conclusion more intelligent, autonomous hard drives increase the complexity of scheduling requests command queuing provides some assistance, but does not address all real-time disk I/O issues draining and limiting the on-disk queue can be used to maintain deadline constraints several aspects of disk behavior is still unexplained and until these are resolved, no absolute guarantees can be made

Previous Work Pro's takes advantage of drives internal mechanisms can guarantee most requests in a round uses Linux, a commodity OS uses an admission controller for the real-time requests Con's constrained to the time interval of a round all requests of one round are treated as equal priority does not mention about priority of disk device driver

constrain the internal features of a disk in order to provide some idea of reserved bandwidth start with periodic requests (benefit from the knowledge of upcoming requests) as time gets close to the real-time request reduce admission of best-effort requests to the disk (gradually lower on-disk requests) may also want to constrain the region in which the disk can do work if the region of the real-time request is known reserve bandwidth for some time interval Work in progress

disk drive has a worst-case bandwidth admission control can allocate up to this parameter after that cannot guarantee anything else for hard real-time constraints best-effort requests can fit before real-time requests as long as the requests do not jeopardize the upcoming real-time request (worst-case service time) real-time requests usually will not fill the entire time allocated for the worst case bandwidth therefore time will be available for best-effort requests use ordered tag to send best-effort requests after ALL known real-time requests are issued to the disk

Work in progress Differences between read/writes writes normally require a longer settle time time for head position to stabilize on the selected track

Work in progress Metrics extent to which real-time request exceeded deadline (for hard real-time this should be 0) average response time of real-time request in comparison with calculated worst-case time bandwidth of best-effort requests average/min/max of on-disk queue depth used NCQ allows for only 32 on-disk requests are more really needed such as the SAS drives with 256 requests (SCSI TCQ has a maximum queue length of 2^64) stress an actual implementation displaying video with best-effort applcations in the background (compile kernel, copy large files, etc.)

Constraining the Disk Reduces Efficiency Not necessary to send ordered tag right away sending the ordered tag may put unnecessary constraints on the internal scheduler may be better to stop future requests until the real- time request is completed or to some minimum internal disk queue length