New version page

UTD CS 5348 - I/O Management

Upgrade to remove ads
Upgrade to remove ads
Unformatted text preview:

Section 11: I/O Management For Exam: Your answers will be penalized if you describe the disk blocks used to maintain file contents as “Memory”. For Exam: Know the seven components of the Layered I/O Architecture. Question 1 Name and briefly describe the two operating systems design objectives for I/O Management? Answer Efficiency: To obtain the best overall performance from processing (executing) the requests submitted to an I/O device e.g. data transfer rate or disk utilization. Generality: To provide a standard interfaces between the layers in the operating system’s design. For example, the upper-layer of the OS stack provides a common API that can be used by a program to access most type of I/O devices. The lower-layers of the stack provide a driver interface that is standard across all vendors or drive hardware interfaces. Question 2 1. What is a Device Driver and what role does it play in OS design? 2. How does the use of device drivers support the goal of Generality in OS Design? Answer 1. The device driver is a software module (e.g. a library) that is loaded and installed into the OS between the I/O subsystems and the hardware interfaces to the physical device. For example, a driver is written to a specific operating system (Linux, Windows, etc.) and a specific device controller (a specific type SATA Disk Controller, USB Controller, Graphics Processor, etc.). 2. The driver’s main purpose is to translate the generic I/O commands issued by the OS subsystem (read / write block) into commands executed by the system’s hardware. In this way the generic operations issued by the OS can be translated into vendor-specific hardware commands needed to execute / fulfill those commands. New devices can be installed on the system without modification to the operating system. Question 3 1. Describe why we describe drives as ‘block devices’. 2. Explain how data addressed by block devices.3. Describe the steps required to update the data (e.g. a record) stored on a block device. Answer 1. Block devices stores and manages its data in fixed sized blocks of 4096 bytes of data. Data is transferred to / from these devices as blocks of data rather than one word / byte at a time. 2. The OS commands the device to retrieve data, or save data as specific block addresses starting at one (first block) though block N where N is the capacity of the drive (in bytes) divided by the block size. 3. Data Update: a. The block containing the record must be read from the device into memory. b. The record within the block is updated in memory. c. The entire block is written back to the drive. This includes the data surrounding the record which was not updated. The key point is that data is not manipulated directly on the drive. The block containing the data to be updated must first be copied into memory where it can be accessed by the processor. Question 4 1. From the slides, what is the danger of caching disk blocks in kernel-space block buffers? 2. What system call does the Linux OS provide to address this problem? Answer 1. There is the danger of losing data that was written by the process but has not been physically written to disk because the write operation is waiting to be scheduled or is being cached. 2. The Linux/UNIX OS provide the system call is fsync(). The call fsync() forces the OS to write the data block cached in memory out to the disk. This includes not only cached data blocks, but the blocks maintaining file system data structures such as the FAT and Unallocated Block List. Question 5 1. What purpose do drive partitions serve? 2. What is the relationship between a drive’s block capacity and the partitions maintained on the drive? 3. How are the blocks in a partition addressed?Answer 1. Partitions allow the system administrators to allocate drive storage blocks to hosting file systems in units smaller that the entire drive’s capacity. For example, instead of allocating the entire drive’s capacity to a single file system, two (or more) partitions can be created on a single drive and used to host two separate file systems on the same physical drive. 2. The drive’s capacity of N blocks is divided among the 2 or more partitions on the drive e.g. A 1000 block drive with blocks 0-999; P1: 0-249; P2: 250-999. 3. The drive’s set of N blocks is divided into consecutive regions (partitions). Each partition is addressed in its own 0-M block logical address range apposed . Question 6 What are the two techniques for implementing Least Frequently Used replacement policy implemented for disk block cache replacement? (See text) Answer 1. Logically arrange cached blocks into a stack. Each time a cached block is referenced, move it to the top of the stack. New blocks are pushed to the stack top. Select the block on the bottom of the stack for replacement. 2. Each disk block cache entry maintains a counter that is incremented each time the cache block is referenced. Blocks with the smallest reference count are selected for replacement. Question 7 1. In RAID terms, what is Data Striping? 2. In terms of RAID0, describe the difference between the logical view of the drive seen by the operating system and the RAID’s physical implementation across N disks. Answer 1. Data Striping is storing the blocks that make up a file system across several drives (partitions) in the RAID. Pg 498. 2. Logically the OS see a RAID0 drive as N*M blocks where N is the number of disks in the RAID and M is the number of blocks per disk (assuming that all disks are of the same size). Logical block 0 is mapped to disk 0 block 0. Logical block 1 is mapped to disk 1 block 0. Logical block N is mapped to disk 0 block 1. Etc. Question 8 1. What are three advantages of RAID1 (mirroring) given in the book? (Assume a two disk RAID)2. What is the primary disadvantage of RAID1? Answer Raid 1 is also known as “disk mirroring” where data is duplicated across (written to and read from) two disks. 1. Data on the logical RAID drive is protected from a single-disk failure. 2. A read request can be serviced by either of two disks and two read requests can be executed concurrently. 3. Even though both disks need to be updated for a write operation, the write can be executed concurrently on both disks. Disadvantage: Because a block is mirrored on two disks, RAID1 uses only half the physical capacity of the RAID. Question 9 1. What advantage does RAID2-6

View Full Document
Download I/O Management
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...

Join to view I/O Management and access 3M+ class-specific study document.

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

Join to view I/O Management 2 2 and access 3M+ class-specific study document.


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

Already a member?