2.3.5 disk scheduling and elevator Algorithm

Source: Internet
Author: User
2.3.5 disk scheduling and elevator algorithm 2010-12-1409: 39 Yang Dongqing Wu yuqing translated Machine Industry Press size: T | T comprehensive rating: Want to read (14) reading (4) read (6) product study (4) 24 people have published book reviews, database system implementation (2nd edition), Chapter 4 auxiliary storage management, this chapter describes a typical computer system that we need to know.

2.3.5 disk scheduling and elevator algorithm Yang Dongqing/Wu yuqing translated Machine Industry Press size: T | T overall rating: Want to read (14) read (4) read (6) pinshuzhai Jian (4) 24 people have published book reviews, database system implementation (version 2nd), Chapter 4, assisted storage management. This chapter describes a typical computer system that we need to know.

2.3.5 disk scheduling and elevator Algorithm

Yang Dongqing/Wu yuqing translated by Mechanical Industry Press Font: T | T

Overall rating:

Want to read (14) reading (4) reading (6) pinshu Zhai Jian (4) 24 people have published book reviews

Database System implementation (version 2nd) Chapter 2nd assists in storage management. This chapter describes how a typical computer system needs to be known for storage management. We will review the storage layer, where the access speed of the device decreases while the storage space increases. We will pay special attention to the disk and study the effect of the Data Organization on its access speed. We will also learn how to improve disk reliability. This section describes disk scheduling and elevator algorithms.

AD: WOT2015 Internet O & M and Developer Conference selling tickets

2.3.5 disk scheduling and elevator Algorithm

Another effective way to increase the disk system throughput is to allow the disk controller to select one of several requests for first execution. This method cannot be used when the system needs to access disk blocks in a certain order. However, if requests come from independent processes, these requests generally benefit from fair and prudent scheduling by the scheduler.

A simple and effective method for scheduling a large number of block requests is called the elevator algorithm (elevator algorithm ). We regard the head as a scanning across the disk, from the inner ring of the cylinder to the outermost ring, and then return back, just as the elevator performs vertical movement, from the bottom layer of the building to the top layer, and then return it back. When a head passes through a cylindrical, if one or more requests are sent to the block on the cylindrical head, the head stops. All these blocks are read or written according to the request. Then the head moves in the same direction as it is traveling until the next cylinder contains the block to be accessed. When the head moves to a certain position in the direction, there are no access requests in front of the position, and the head moves in the opposite direction.

Example 2.6 assume that we are scheduling a Megatron 747 disk. We recall that the average seek time, rotation wait time, and transmission time of the disk are 6.46, 4.17, and 0.13 respectively (in this example, all time is calculated in ms ). Suppose there is a block access request to the cylinder 8000, 24000, and 56000 at a certain time. The head is located at cylinder 8000. In addition, there are three block access requests, which will arrive later, as summarized in 2-6. For example, an access request to 16000 of a cylindrical block is generated in 10 ms.

We will assume that each block access results in 0.13ms transmission time and 4.17ms average rotation wait time, that is, no matter what the seek time is, we need to add 4.3 ms for each block access. Track time can be calculated according to the Megatron 2.2 rule given in example 747: 1. The number of tracks is divided by 4000 (1 + number of tracks/500 ). Let's see what will happen if the elevator algorithm is used for scheduling. The first request to the cylinder 8000 does not need to be traced because the head has been located there. In this way, the first access will be completed at 4.3ms. The request for Cylinder 16000 has not yet arrived, so we move the head to cylinder 24000, that is, the next "station" we requested in the direction of the largest digital track ". Tracing from cylinder 8000 to 24000 takes 5 ms, So we arrived at 9.3 and completed the access within another 4.3ms. In this way, the second access is completed at 13.6. Before this time, the request to the cylinder 16000 has arrived, but we passed the cylinder at the time 7.3 and won't return to that position until the next pass.

In this way, we will move to the cylinder 56000 and spend 9 ms for seek and 4.3ms for rotation and transmission. In this way, the third access is completed at 26.9. Now, the request for Cylinder 64000 has arrived, so we continue to move towards the outer ring. We need 3 ms to find the path, so the access is completed at 26.9 + 3 + 8.3 = 34.2.

At this time point, 40000 requests to the cylinder have been generated, so now there are still requests for this request and 16000 requests to the cylinder. So we traveled in the inner ring to process these two requests. -7 summarizes the processing time of each request.

-6. arrival time of 6 block requests
-7. block access completion time using the elevator Algorithm
Let's compare the performance of the elevator algorithm with a simpler method such as "first come first served. Assume that the first three requests are in the order of 8000, 24000, and 56000. The first three requests are processed in the same way. However, at that point, we need to go to the cylinder 16000, because it is the cylinder to be reached by the fourth request. The tracing time for this request is 11.0 ms, because we traveled from the cylindrical cylinder 56000 to 16000, and the travel time was more than half that of the Cross-disk. The fifth request is for the cylinder 64000, which requires a tracing time of 13 Ms. The last request is for the cylinder 40000, And the tracing time is 7. -8 summarizes the activities generated by the "first come, first served" scheduling method. The difference between the two algorithms is 14 ms, which may not seem very significant, but note that in this simple example, the number of requests is small, it is assumed that there is no difference between the two algorithms before the fourth of the six requests.

[Responsible editor: Yunxia TEL :( 010) 68476606]


Bibliography Previous section Next section

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.