1
$\begingroup$

I learn from the OS schoolbook that the OS has the function that schedule the disk requests with the knowing algorithms such as SSTF, SCAN .. However, the date layout inner disk drives now is very complex that we may can't know. Disk zoning, disk skew, disk slipping and many other features of disk drives changes the distribution of data layout. So how can the OS do this work ? Thanks!

$\endgroup$
1
$\begingroup$

Modern disks interfaces provide an approximation of position called the logical base address. This is just a linear integer indexing scheme where each block gets a unique integer assigned to it.

While you can't calculate an exact "distance" (in terms of arm movement latency and rotational latency) between two blocks it is approximately the case that if the difference between address $a$ and address $b$ is smaller than the distance between address $a$ and address $c$ then block $a$ will be closer to block $b$ than it is to block $c$.

Disk scheduling algorithms try to improve average latency or average throughput without being significantly unfair or causing starvation. They also don't know about requests that are going to arrive in the future, so whatever they do needs to be an approximation based only on the requests they've already seen.

Since the algorithms are approximate anyway, the fact that we don't know the exact distance between two requests is not particularly a problem.

$\endgroup$
  • 1
    $\begingroup$ It might also be worth noting that many more recent disks have command queues in the drive itself, allowing the drive to perform some access optimization based on its knowledge of placement and seek and rotational latencies. $\endgroup$ – Paul A. Clayton May 16 '14 at 13:07
  • $\begingroup$ Can you explain how the OS get approximate of arm movement ? After scheduling the disk requests, will the OS send the request one by one after the previous request completed ? Or can the OS send one disk request before the previous request completed ? $\endgroup$ – river May 16 '14 at 14:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.