Deep understanding of the Linux kernel-block device drivers

Source: Internet
Author: User

Sector:

1. The hard disk controller sees the disk as a large set of sectors
2, sector is a group of neighboring bytes
3, Sector set by convention size bit 512 bytes
4. The data stored in the block device is identified by their location on the disk, that is, the number of subscripts and sectors of the first sector.
5, the sector is a hardware device to transmit data to the basic unit.

Block:
1, block is the VFS and the file system transmits data to the basic unit. It corresponds to one or more contiguous sectors of the disk.
2, when the kernel accesses a file content, it first reads the file from the disk the disk index node is located in the block
3, Linux, the block must be a power of 2, and not more than a page box (General 4kB), but also must be an integer multiple of the sector size.
4, the block device file read and write operation of a primitive access, it bypasses the disk file system
5. Each block has its own buffer

Paragraph
1. A memory page or part of a memory page that contains data from some contiguous disk sectors.
2, different segments in RAM the corresponding page box is exactly contiguous and the corresponding data block on disk is also adjacent, then the general block layer can be merged with them, this way to produce a larger memory area is the physical segment.


Common block Layer:
1. The common block layer is a kernel component that handles requests from all block devices in the system

I\O Scheduler:
1. Block device drivers can transmit one sector at a time, but the block i\o layer does not do so because it is time-consuming to determine the physical location of the sector on the disk surface. So whenever possible, the kernel tries to handle several sectors as a whole.
2. When the kernel component reads and writes disk data, it is actually creating a block device request. The essence is to describe the requested sector and the type of operation performed on him.
3, the request, i\o operation is only dispatched, execution will be deferred backward, the purpose is to improve the performance of block equipment.


I\o Scheduling algorithm:
1. Expected algorithm
2, the last term algorithm
3, CFQ (complete fairness queueing) Full fairness algorithm:
4, Noop (No operation) algorithm:
5, Elevator algorithm:

Block device drivers:
1. Components at the bottom of the Linux block subsystem
2. Block device drivers are part of the device driver program.
3, may handle several pieces of equipment

Block device:
1.







Deep understanding of the Linux kernel-block device drivers

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.