CS623: Lecture 4 2/17/2004 © Joel Wein 2003, modified by T. Suel.

Slides:



Advertisements
Similar presentations
I/O Management and Disk Scheduling
Advertisements

I/O Management and Disk Scheduling
I/O Management and Disk Scheduling Chapter 11. I/O Driver OS module which controls an I/O device hides the device specifics from the above layers in the.
Chapter 11 I/O Management and Disk Scheduling
Chapter 4 Device Management and Disk Scheduling DEVICE MANAGEMENT Content I/O device overview I/O device overview I/O organization and architecture I/O.
I/O Management and Disk Scheduling
I/O Management and Disk Scheduling
Chapter 12 File Management Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
File Management Chapter 12. File Management File management system is considered part of the operating system Input to applications is by means of a file.
File Management Chapter 12. File Management A file is a named entity used to save results from a program or provide data to a program. Access control.
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
1 Chapter 11 I/O Management and Disk Scheduling –Operating System Design Issues –I/O Buffering –Disk Scheduling –Disk Cache.
CS 104 Introduction to Computer Science and Graphics Problems Operating Systems (4) File Management & Input/Out Systems 10/14/2008 Yang Song (Prepared.
1 Storage Hierarchy Cache Main Memory Virtual Memory File System Tertiary Storage Programs DBMS Capacity & Cost Secondary Storage.
1 File Management Chapter File Management File management system consists of system utility programs that run as privileged applications Input to.
Chapter 1 and 2 Computer System and Operating System Overview
I/O Management and Disk Scheduling (Chapter 10) Perhaps the messiest aspect of operating system design is input/output A wide variety of devices and many.
Disks.
Device Management.
04/21/2004CSCI 315 Operating Systems Design1 Disk Scheduling.
1 Today I/O Systems Storage. 2 I/O Devices Many different kinds of I/O devices Software that controls them: device drivers.
I/O Management and Disk Scheduling (Chapter 11)
File Management Chapter 12.
Secondary Storage Management Hank Levy. 8/7/20152 Secondary Storage • Secondary Storage is usually: –anything outside of “primary memory” –storage that.
Introduction to Database Systems 1 The Storage Hierarchy and Magnetic Disks Storage Technology: Topic 1.
Disk and I/O Management
Chapter 8 File Processing and External Sorting. Primary vs. Secondary Storage Primary storage: Main memory (RAM) Secondary Storage: Peripheral devices.
External Sorting Problem: Sorting data sets too large to fit into main memory. –Assume data are stored on disk drive. To sort, portions of the data must.
Device Management. So far… We have covered CPU and memory management Computing is not interesting without I/Os Device management: the OS component that.
File Management Chapter 12. File Management File management system is considered part of the operating system Input to applications is by means of a file.
I/O Management and Disk Scheduling
Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
Operating Systems CMPSC 473 I/O Management (4) December 09, Lecture 25 Instructor: Bhuvan Urgaonkar.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
Computer System Overview Chapter 1. Operating System Exploits the hardware resources of one or more processors Provides a set of services to system users.
Chapter 1 Computer System Overview Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 13+14: I/O Systems and Mass- Storage Structure I/O Hardware Application I/O.
1 I/O Management and Disk Scheduling Chapter Categories of I/O Devices Human readable Used to communicate with the user Printers Video display terminals.
1 IO Management and Disk Scheduling Chapter Categories of I/O Devices n Human readable u used to communicate with the user u video display terminals.
1 I/O Management and Disk Scheduling Chapter
1 I/O Management and Disk Scheduling Chapter Categories of I/O Devices Human readable  Used to communicate with the user  Printers  Video display.
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.
I/O Management and Disk Structure Introduction to Operating Systems: Module 14.
OSes: 11. FS Impl. 1 Operating Systems v Objectives –discuss file storage and access on secondary storage (a hard disk) Certificate Program in Software.
CS414 Review Session.
External Storage Primary Storage : Main Memory (RAM). Secondary Storage: Peripheral Devices –Disk Drives –Tape Drives Secondary storage is CHEAP. Secondary.
1 I/O Management and Disk Scheduling Chapter Categories of I/O Devices Human readable –Used to communicate with the user –Printers –Video display.
I/O and Disk Scheduling CS Spring Overview Review of I/O Techniques I/O Buffering Disk Geometry Disk Scheduling Algorithms RAID.
File Management Chapter 12. File Management File management system is considered part of the operating system Input to applications is by means of a file.
1 File Management Chapter File Management n File management system consists of system utility programs that run as privileged applications n Concerned.
UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department
I/O Management and Disk Scheduling Chapter 11. Categories of I/O Devices Human readable Used to communicate with the user  Printers, Display terminals,
1 I/O Management and Disk Scheduling Chapter I/O Devices Can be group into three categories: 1.Human readable Used to communicate with the computer.
I/O Devices. Characteristics of I/O Devices  Block Devices  Information are stored and accessed in fixed-size blocks  Addressable, can have sequential.
1 Virtual Memory. Cache memory: provides illusion of very high speed Virtual memory: provides illusion of very large size Main memory: reasonable cost,
Device Management Mark Stanovich Operating Systems COP 4610.
Chapter 9 I/O System. 2 Input/Output System I/O Major objectives are: Take an application I/O request and send it to the physical device. Then, take whatever.
I/O Scheduling Computer Organization II 1 Disk Scheduling Carrying out disk accesses in the order they are received will not always produce optimal performance.
Chapter 101 I/O Management and Disk Scheduling Chapter 11.
Chapter 11 I/O Management and Disk Scheduling Dave Bremer Otago Polytechnic, NZ ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
1 Chapter 11 I/O Management and Disk Scheduling Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and.
Chapter 37 Hard Disk Drives
Overview Continuation from Monday (File system implementation)
Operating Systems.
Persistence: hard disk drive
Chapter 11 I/O Management and Disk Scheduling
Disk Scheduling Carrying out disk accesses in the order they are received will not always produce optimal performance. Seek time is the reason for differences.
Presentation transcript:

CS623: Lecture 4 2/17/2004 © Joel Wein 2003, modified by T. Suel

Review of I/O - Key Issues Current performance battleground: – Processor speeds increasing, SMPs coming – Internal memory getting faster, multi-level caches – I/O to disk lags behind – But not capacity: data sets growing with disks File Systems: – Performance – Reliability – Security – Distributed File Systems

Organization of the I/O Function Programmed I/O: – I/O-to-memory transfer through processor. – Processor issues an I/O command, on behalf of process, to an I/O module. Process busy-waits for operation to be completed before proceeding. Interrupt-Driven I/O: – Processor issues I/O command on behalf of process, continues to process, is interrupted by I/O module when done “synchronous vs. asynchronous I/O”

Organization of the I/O Function Direct Memory Access: – Direct I/O to Memory transfer – DMA module controls exchange of data between main memory and I/O module. – Processor interrupted only after entire block has been transferred.

Evolution of I/O Function 1. Processor directly controls a peripheral device. 2. Controller or I/O module added. Proc uses programmed I/O w/o interrupts. Proc becomes somewhat divorced from details of external device interfaces 3. Add interrupts. Processor does not need to wait for I/O to happen 4. I/O module is given direct control of memory via DMA. Can now move a block of data to or from memory without involving the processor, except at the beginning and end of each transfer. 5. I/O module is enhanced to become a separate proc 6. I/O module has local memory and is own computer

OS Design Issues Design Objectives – Efficiency Generality – handle devices in a uniform fashion. – Hierarchical, modular approach – Hide most of details of device I/O in lower-level routines Logical Structure of I/O Function

Logical I/O: deal with device as logical resource and not concerned with details of controlling the device Device I/O: Requested operations and data are converted into appropriate sequences of I/O instructions, channel commands and controller orders. Scheduling and Control: Actual queueing and scheduling of I/O operations. See Figure 11.5

Additional Layers Directory Management – Symbolic file names converted to identifiers that reference file directly or indirectly through file descriptor or index table. File system: – Logical structure of files, operations that can be specified by users, such as open, close, read, write. Access rights managed here too. Physical Organization

I/O Buffering Suppose we are reading blocks of data from tape one at a time: – Program has to wait for I/O, may be swapped out – Approach to I/O interferes with OS swapping decisions. Target locations must remain in main memory. Impossible to completely swap the process out. – If swap out could get a single-process deadlock. Process issues I/O command, suspended awaiting result, swapped out waiting. Process blocked waiting on I/O, I/O blocked waiting for it to be swapped in.

must lock certain areas of memory involved in I/O try to ameliorate by doing input transfers in advance of requests made and to perform output transfers sometime after a request is made

Single Buffering When user process issues I/O request, OS assigns a buffer in system portion of main memory to the operation. – Input transfers made to system buffer – When transfer complete, moved to user space, – Immediately request another block – anticipated input. Advantages: – Speedup – Can swap process out because I/O to system memory, not user space Double Buffer: A process transfers data to one buffer while the OS empties or fills the other

Circular Buffer Double buffering may be inadequate if process performs rapid bursts of I/O. Use multiple buffers. NOTE: No amount of buffering will allow an I/O device to keep pace with a process indefinitely when average demand of process is greater than I/O device can service – Even with multiple buffers, all of the buffers will eventually fill up and the process will have to wait after processing each chunk of data. – In a multiprogramming environment, when there is a variety of I/O activity, etc., it can help

I/O systems function using disk hardware Drive Geometry – Disks are designed as circular platters stacked one on top of another – Tracks are defined in each disk as circular structures at some predefined radius – Sectors are one slice of a track – Cylinders are one set of tracks across all the disks

Disk Scheduling Seek time: – Startup time, traversal time, settling time – Average seek time “today:” 5 to 10 ms. Rotational Delay – 5400 to rpm – rpm = one revolution per 6 ms; average rotational delay 3ms. Transfer time to or from disk: bytes/(Bytes per Track)*Rotation Speed (RPS)

Example 1 Average seek time: 10 ms Rotational Speed: 10,000 RPM Format Characteristics: – 512 Bytes/Sector – 320 Sectors/Track Read a file of 1,310,720 (1.3MB) – two cases: a) it’s fully sequential – 8 tracks, 8x320=2560 sectors. b) it’s 100% fragmented (Random access)

Fully sequential 2560 Sectors Average seek: 10ms Rotational delay: 3 ms Read 320 sectors: 6 ms. So, time to read 1 st track = 19 ms. Suppose rest of tracks have no seek time *9 =.082 seconds.

Random Average seek 10 ms Rot delay 3 ms. Read 1 sector ms 2560 x ms = sec. Order in which sectors read from disk makes a difference Important to keep files “together” on disk

Disk Scheduling Policies: Queue/Requestor-Based Random – Select items from queue in random order (bad) FIFO – Process items from queue in seq. order; fair. – Good if a few processes do access to clustered file sectors – If many processes competing for disk, approaches random Priority – Does not optimize disk utilization but meets other objectives within the OS LIFO – Always take most recent request – Great for a sequential file – Starvation possible

Disk Scheduling Policies: Advanced SSTF– choose I/O request with least seek time. Better than FIFO (all these algos except for FIFO can have starvation) SCAN: – Arm moves in one direction, satisfying all outstanding requests. – When hits last request, turns around. – LOOK policy: Stop early if no more requests – Also called elevator

More policies: C-SCAN: Restricts scanning to one direction only N-step-SCAN, FSCAN – SSTF, SCAN,C-SCAN can all have “arm stickiness”, monopolizing device by repeated requests to close-by tracks – segment disk-request queue in segments of size N: one segment at a time processed completely. – FSCAN: All new requests in 2 nd queue during scan

File Management - Terms Field: Basic element of data; could be fixed or variable-length. Record: collection of related fields that can be treated as a unit by some application File: collection of similar records Database: collection of related data. – Relationships are made explicit in database. Operations: – Retrieve_all/One/Next/Previous – Insert_One/Delete_One/Update_One – Retrieve_Few

File System Architecture Device Drivers: communicate directly with peripherals Basic file system/physical I/O – Blocks of data that are exchanged with disk and tape systems. – Deals with placements of those blocks on secondary storage device and on buffering of these blocks. No notion of content or structure of files involved.

File System Architecture (cont.) Basic I/O Supervisor: – File I/O initiation and termination – Scheduling disk and tape accesses to optimize performance. Logical I/O: Enable users and applications to access records. Deals with file records, not general blocks of data.

File Organization and Access file organization: logical structuring of records as determined by the way they are accessed Criteria: – Rapid access – Ease of update – Economy of storage – Simple maintenance – Reliability can be at tension: – Economy of storage v. rapid access