Disk management
Article Directory
One, the structure of the disk
1. Disks, tracks, sectors
2. How to read and write data on the disk
You need to move the head to the track where the sector you want to read and write is located, and the disk will rotate so that the target sector will be swiped under the head to complete the read and write operations on the disk.
3. The physical address of the disk
4. Knowledge review
Second, the disk scheduling algorithm
1. The time required for a disk read and write operation
Time required = seek time + delay time + transmission time
(1) Seek time: the time it takes to move the head to the specified track before reading and writing data
(2) Delay time: the time required to position the head to the beginning of the target sector by rotating the disk
(3) Transmission time: the time that the disk rotates and reads and writes data from the target sector of the disk
2. First come first served (FCFS)
Scheduling according to the sequence of process requests to access the disk
3. Shortest search time first (SSTF)
The priority track is the track closest to the current head
Advantages: good performance, short average seek time.
Disadvantages: the head may move back and forth in a small area, which may cause starvation.
4. Scanning Algorithm (SCAN)
The head can only move inward when it moves to the outermost track, and can move outward when it moves to the innermost track.
Disadvantages:
(1) The head movement direction can only be changed when it reaches the outermost side. In fact, after the 184 access is completed, you can return without accessing 200 tracks. You can use the LOOK algorithm to solve this problem: if there is no other request in the head movement direction , You can immediately change the head movement direction
(2) The response frequency of each position of the track is not even: the one that is close to the end point will be accessed a second time soon
5. Cyclic Scan Algorithm (SCAN)
The track access request is processed only when the head moves in the specified direction, and when it returns, it moves directly to the beginning without processing any request
Disadvantages: no need to move to the right end to return to the beginning, you can use the C-LOOK algorithm to solve this problem
6. Knowledge review
3. Ways to reduce disk latency
-
The head needs a short period of time after reading the data of a sector, that is to say, it cannot read the next adjacent sector continuously after reading a sector.
-
Ways to Reduce Delay Time-Alternate Numbering
Let logically adjacent sectors have a certain physical interval
- Ways to reduce delay time-misplaced naming
The sector numbers are misplaced and named at the same relative position on adjacent disks