-3

When you request disk for data, it usually first gets transferred to the disk buffer in the disk controller, and then it gets sent up to RAM (and thus stored in memory). I was just wondering what the benefits were for having the buffer (which essentially is an extra step) in the first place.

*edit-> also, can someone explain what a RAID controller is supposed to do?

2
  • A RAID controller controls the disks in a RAID array, typically with specialized hardware to accelerate the RAID operations. Oct 27, 2011 at 8:52
  • 1
    @Kaitlyn: While I admire your enthusiasm for your current course of study, this is not a site for asking homework questions regarding your course of study. All of your questions have been related to your studies and not to actual real world problems/issues. You'd be better served by simply following the questions here that interest you and saving your own questions for your teacher and/or fellow students. Also, Google is a great resource for finding information related to CS and technology in general. Hope to see a real question from you in the future, that we'll gladly do our best to answer.
    – joeqwerty
    Oct 27, 2011 at 11:37

1 Answer 1

5

It permits the controller flexibility in timing when data is moved to and from the computer. Consider how awful things would be without a buffer:

Reads: The controller would have to quiet the link to the computer when the data was about to become available. If the computer tried to send some data to the controller as the data that was being read from the disk came around, the controller would have to throw the data away and wait for it to come around again, having no place to put it. If the computer wanted to read block 1, 2, 3, and 4 and 5, 6, 7, and 8 came around first, the controller would just have to ignore them and if the computer asks for them a split-second later, the controller will have to wait for them to come around again.

Writes: The controller couldn't re-order writes to make seeks efficient. And if it had some data that it had read while trying to read other data that the computer might ask for shortly, it would have to throw it away to do a write. The controller would have to get the computer to send the data to be written at precisely the right instant, and order the computer to send the data slower or faster depending on which track was being written to.

In sum, the controller uses the buffer:

For reads: To hold data that it 'accidentally' reads while waiting for other data to come around. To allow it to read a track in one rotation regardless of which part of the track comes under the head first. To hold data that might be needed shortly while it goes to do other things.

For writes: To allow the computer to write at full interface speed (at least for short periods of time). To re-order writes for more efficient seeking. To allow a track to be received in order from the computer and written out in whatever order the sectors happen to land under the head. (Obviously, the disk may need to write 0-63, and sector 14 may be the first one under the head. If it has all the data before it writes any of it, it can immediately write 14-63 and then 0-13 and finish in one spin rather than waiting for 0 to come around and needing two.)

1

Not the answer you're looking for? Browse other questions tagged .