Disks
The architecture of the disk has affected the design of the OS. In particular, it has affected the algorithms used to schedule disk requests, since those must be handled efficiently.
Seek time
C-LOOK
No, the algorithm focuses on decreasing seek time, which is not an issue in SSDs, as there is no disk head
What size do you choose and why? What are the disadvantages of your choice? You may assume that a sector on disk is 512 bytes.
I would choose a block size that is neither too big nor too small: probably 4KB. An advantage of such a block size would be, the ease of reading and writing out in blocks as it would (usually) match the page size in memory. Another advantage would be that most files are small and 4KB is small enough to not cause too much internal fragmentation. A disadvantage would be that even though this supports large files, it would not be ideal as the large file would be split into a lot of blocks.
Seek time must be calculated for each random read, but only once for a sequential read, and seek time is the most expensive part of disk access time
(b) [2pts] What is the other piece(s) of disk access time?
Transfer time
Rotational latency
Disks
When we discussed disks, we studied both spinning disks and solid state drives. We then discussed many policies in the operating system, such as disk scheduling algorithms and file layout policies, that are optimized based on the structure and costs of the spinning disk. The solid state drive, however, is different, with characteristics like multiple independent data paths, erasure blocks, and no moving parts.
Extents can decrease the amount of space needed in a record, by listing a range of sectors allocated rather than each sector individually
(b) [3pts] What is the benefit of extents on a SSD?
Same as spinning disk
No, SSD has no disk head or spinning disk, so C-SCAN could not be implemented in an SSD
There are no moving parts in an SSD so random reads are fast
Read disturb could possibly be affected by reads
No, there are no moving parts so there is no seek time. The new top concern could be eliminating file layout fragmentation
None. SSDs do not have a head so no need to schedule. Just process the requests in the order received by the disk (not necessarily FIFO).
Outside track would be more efficient because no matter what we always must visit the outermost track when the head jumps to the outside sector. We don’t always have to visit the innermost track
The journal is first updated atomically with all the required updates to file system before performing the actual updates. This is done so that in case of a crash if the journal does not have a commit (incomplete journal), we do not perform any actual updates, otherwise if there is a commit, we perform all the updates. So the file system remains consistent by doing either no updates or all updates.
(b) [4pts] We considered (so far) one way that cost might be reduced through scheduling. What sort of scheduling algorithm reduces that cost, and which one would you choose for an OS that will only access a single (spinning) disk partition at a time? Defend your answer.
LOOK - this is because LOOK works with any bounds for tracks and not necessarily just the inner and outer tracks of a disk.
(c) Now consider the file layouts we studied. (Remember that we are considering spinning disks!)
i. [2pts] Which one would have the best time to write an entire very large file? Defend your answer.
Contiguous allocation: This is because it would require only a single seek and then only have to write data continuously (so only rotational and transfer latency would need to be worried about).
ii. [2pts] Given a fragmented (spinning) disk, would you still choose the same file layout? Defend your answer.
No. If the disk is very fragmented, contiguous allocation would be bad as it would be very difficult to find contiguous spots in a fragmented disk to fit large files.
(a) [2pts] What is the dominant cost of a write?
Block erasure
Remapping - Keep an empty block to which all page writes are done. A block erasure would be needed only when the entire block fills up, amortizing its cost.