Unformatted text preview:

Chapter 13-4 I/O SystemsChapter 13: I/O SystemsKernel I/O SubsystemSlide 4Disk SchedulingDevice-status TableBufferingSun Enterprise 6000 Device-Transfer RatesBuffering - moreCachingSpoolingError HandlingI/O ProtectionKernel Data StructuresUNIX I/O Kernel Structure (same figure)Kernel Data Structures – NT I/OKernel I/O Subsystem SummaryA Kernel I/O StructureTransforming I/O Requests to Hardware OperationsI/O Requests to Hardware Operations: 1I/O Requests to Hardware Operations: 2I/O Requests to Hardware Operations: 3Life Cycle of An I/O RequestPerformanceSlide 25Improve I/O Performance?Last IssueDevice-Functionality ProgressionEnd of Chapter 13-4Chapter 13-4 I/O SystemsChapter 13-4 I/O Systems13.2Silberschatz, Galvin and Gagne ©2005Operating System ConceptsChapter 13: I/O SystemsChapter 13: I/O SystemsChapter 13-1 and 13-2.I/O HardwareChapter 13-3Application I/O InterfaceKernel I/O SubsystemTransforming I/O Requests to Hardware OperationsPerformance13.3Silberschatz, Galvin and Gagne ©2005Operating System ConceptsKernel I/O SubsystemKernel I/O Subsystem13.4Silberschatz, Galvin and Gagne ©2005Operating System ConceptsKernel I/O SubsystemKernel I/O SubsystemI/O ServicesSchedulingBufferingCachingSpoolingDevice Reservation and Error HandlingI/O system is also responsible for protecting itself from malicious or accidental misuse.Much more on these topics in the next couple of chapters.Remember: the kernel is tht part of the operating system that is always resident. Thus these ‘services’ are always available (and quite necessary)13.5Silberschatz, Galvin and Gagne ©2005Operating System ConceptsDisk SchedulingDisk SchedulingScheduling blocking I/Os:A good ordering of disk I/O request handling is critical.Want to reduce average wait times and yet not starve others.Disk Scheduling was discussed in the previous chapter. FCFS, SSTF, SCAN, ….Requests for service are entered into a wait queue in some kind of an optimal order depending upon the scheduling algorithm. Asynchronous I/OA different animal – we must keep track of potentially many I/O requests at the same time.Here, a wait queue is often attached to some kind of device status table.Table is associated with specific devices and indicates device status: is busy, idle, or not working…Thus judicious scheduling I/O operations is an effective way to speed up I/O operations Without question, I/O is the slowest operation on a computer.13.6Silberschatz, Galvin and Gagne ©2005Operating System ConceptsDevice-status TableDevice-status TableCan see the queues.13.7Silberschatz, Galvin and Gagne ©2005Operating System ConceptsBufferingBufferingBuffering techniques are used throughout computer systems in so very many ways.Main idea is that buffers serve to address the inherent mismatch in speeds/ timing/ etc., between two or more devices or between a device and an application.These mismatches arise due to incredible differences in speed between devices such as, say, modems and a disk.As an example, buffers may be created (in this case) in main memory to accumulate inputs; when the entire input is received, a very quick single transfer to disk can readily occur. Done all the time.Often, two buffers are used (double buffering). Here a modem can continue to fill one buffer while the other buffer’s data is written to disk.Double buffering is used in many applications too to speed up I/O handling – but there’s a cost: space in the application’s address space, for one thingIdea behind all this is to decouple producers from consumers.13.8Silberschatz, Galvin and Gagne ©2005Operating System ConceptsSun Enterprise 6000 Device-Transfer RatesSun Enterprise 6000 Device-Transfer Rates13.9Silberschatz, Galvin and Gagne ©2005Operating System ConceptsBuffering - moreBuffering - moreAnother example of the use of buffering takes place in message passing where typically messages are broken down into packets sent over a network.These packets can be reassembled back together for processing…Copy Semantics: We often have buffers of data to be written to, say, disk. When a write() system call is issued, a pointer to the buffer and an integer citing the number of bytes to transfer are passed to the write() system call.We’ve seen this in the device status tables a couple of slides back.But what if the application needs to write more to this buffer or modify it before the physical write takes place? Remember: the I/O is scheduled!Using copy semantics, we guarantee the version sent to disk is correct one.This is accommodated by the system call by the call writing the data into a kernel buffer before returning control to the application. Disk writes then takes place from the kernel buffer.This approach – copying data between kernel buffers and application data space is common in operating systems, even though there is some copying overhead.13.10Silberschatz, Galvin and Gagne ©2005Operating System ConceptsCachingCachingCaching – as opposed to buffering (although they may be used together and may be complementary at times) – really deals with copies of data.First of all, we have our primary memory cache and then there are CPU secondary and primary caches.Buffers typically contain a copy of a data item – whatever it is – maybe a page or perhaps something smaller. But caches represent additional storage usually in faster access storage. (This means the switching technology is much faster!!) Caches are used extensively in improving I/O efficiency in accessing directories, FATs, recently read / written data, and a host of other things…etc.In these cases, cache stores may be accessed much more quickly than a corresponding area of primary memory – or disk.13.11Silberschatz, Galvin and Gagne ©2005Operating System ConceptsSpoolingSpoolingSpooling – a technique usually used as a holding place for data for a device, such as a printer.Spooling is very useful for devices that need non-interleaved access, as in the case of printers or tapes that cannot multiplex I/O requests for concurrent applications.A printer can only print one file at a time.Upon writing output files, application data is ‘spooled’ to a disk file until the entire file is developed. Then, this spool file can be queued up and sent to the printer for printing.Usually there is a daemon


View Full Document

Chico CSCI 640 - Chapter 13-­4 I/O Systems

Download Chapter 13-­4 I/O Systems
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Chapter 13-­4 I/O Systems and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Chapter 13-­4 I/O Systems 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?