0% found this document useful (0 votes)
3 views2 pages

Understanding Block I/O Operations

Block I/O layer handles random access to fixed size blocks of data on block devices like hard disks. Buffers in memory are used to store blocks being read from or written to devices. Each buffer is associated with a buffer head descriptor. Block I/O requests are represented by bio structures which are lists of segments of contiguous buffers. I/O schedulers sort and merge requests in queues to optimize disk access and reduce seek time. The deadline scheduler sorts by location while anticipatory scheduler waits briefly for adjacent requests before seeking.

Uploaded by

avadcs
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Understanding Block I/O Operations

Block I/O layer handles random access to fixed size blocks of data on block devices like hard disks. Buffers in memory are used to store blocks being read from or written to devices. Each buffer is associated with a buffer head descriptor. Block I/O requests are represented by bio structures which are lists of segments of contiguous buffers. I/O schedulers sort and merge requests in queues to optimize disk access and reduce seek time. The deadline scheduler sorts by location while anticipatory scheduler waits briefly for adjacent requests before seeking.

Uploaded by

avadcs
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Block I/O Layer

1. What are block devices? a. If the devices are accessed randomly (non-sequentially), they are called block devices i. Block devices are those devices that randomly access fixed size chunks of data called blocks Examples Floppy drive, CD drives, Flash memory, etc 2. What are char devices? a. Char devices are accessed as a stream of sequential data, one byte after another i. Examples Key board, serial ports, etc 3. What is a sector? a. Sector is the smallest addressable unit on a block device is known as a sector. 4. What are buffers? a. When a block is stored in memory (after read or pending a wrie), it is stored in buffer. Each buffer is associated with one block. 5. What are buffer heads? a. Each buffer in memory is associated with a descriptor. The descriptor is called a buffer head. 6. What is bio structure? a. Bio structure is the basic container for block I/O within kernel. i. It represents block I/O operations that are in-flight (active) as alist of segments. 7. What is a segment? a. A segment is chunk of buffer that is contiguous in memory 8. What are the differences between buffer heads and bio structure? a. Buffer head represents buffer memory in memory bio structure represents segment of buffer in memory. 9. What are Request Queues? a. Block devices maintain request queues to store their pending block I/O requests. 10. What is I/O scheduler? a. Subsystem of kernel that performs sorting and merging operations is I/O scheduler 11. What are the chief operations of I/O scheduler? a. Sorting and merging are chief operations of I/O scheduler 12. Linus Elevator? 13. Deadline I/O scheduler? a. In the deadline I/O Scheduler, each request is associated with expiration time. It maintains a request queue sorted by physical location on disk. This queue in deadline I/O scheduler is called sorted queue. i. Read requests are sorted into a special read FIFO queue ii. Write requests are inserted into a special write FIFO queue iii. Normal queue is sorted by on-disk sector, these queues are kept FIFO iv. New requests are always added to the tail of the queue.

v. Deadline I/O scheduler pulls requests from the head of the sorted queue into the dispatch queue vi. Dispatch queue is fed to the disk drive. This whole operation results in minimal seeks. 14. Anticipatory I/O scheduler? a. Anticipatory I/O scheduler provides excellent read latency and also provides excellent global throughput. i. Anticipatory I/O scheduler is built on Deadline I/O scheduler. ii. It works like deadline I/O scheduler except that after request is submitted, anticipatory I/O scheduler does not immediately seek back and return to handling any other requests. Instead, it does absolutely nothing for few milliseconds (configurable, default value is 6 milliseconds). In those few milliseconds there is a good chance that the application will submit another read request. Any requests that are issued adjacent area of the disk are immediately handled. After the waiting period elapses, anticipatory I/O scheduler seeks back to where it left off and continues handling previous requests.

You might also like