HW7 released: 11/23, 21:00 > Answer the following questions. > Submit your answers to Canvas assignments. There is an entry for this homework. > > > 1. Disk performance > > Here is some numbers of a disk, CS5600-Disk: > > --Spindle Speed: 6000 RPM > (note: this number is per minute. > So, on average, how long does CS5600-Disk > rotate to a certain sector?) > > --Avg Seek Time, read/write: 10ms / 12 ms > (note: this is the time moving heads to the right track.) > > --Transfer rate: 64 MB/s > (note: this is the rate of reading/writing sequential data. > Assume 1MB=10^6B here.) > > When CS5600-Disk reads/writes a sector (512 Bytes), it needs to > (1) move the head to the right track, > (2) wait rotating to the right sector, > and (3) read/write the data. > > Questions: > > (a) How long would it take to do 500 sector reads, spread out > randomly over the disk (and serviced in FIFO order)? > [Write down your calculation and > write the final result in seconds with one decimal place accuracy.] Answer: total time = seek + rotation + transfer for one sector: seek = 10ms [seek time is given] rotation = (60 s/1min * 1min/6000 rotations * 1000 ms/s) / 2 = 5ms [*on average*, it takes the disk to rotate half a circle to read a sector] transfer = 512 Bytes * 1s/64MB * 1MB/10^6 bytes = 8 * 10^-6 s = 0.008 ms [the time to read 512B from the disk] total time = (10+5+0.008) * 500 = 7.5s > > > (b) How long would it take to do 500 sector writes, spread out > randomly over the disk (and serviced in FIFO order)? > [Write down your calculation and > write the final result in seconds with one decimal place accuracy.] > Answer: for one sector: seek = 12ms rotation = (60 s/1min * 1min/6000 rotations * 1000 ms/s) / 2 = 5ms transfer = 512 Bytes * 1s/64MB * 1MB/10^6 bytes = 8 * 10^-6 s = 0.008 ms total time = (12+5+0.008) * 500 = 8.5s > > (c) How long would it take to do 500 sector reads, SEQUENTIALLY on the > CS5600-Disk? (FIFO order once more) > [hint: notice that some actions only appear once in this case.] > [Write down your calculation and > write the final result in milliseconds with one decimal place accuracy.] > Answer: seek = 10ms [this happens once] rotation = 5ms [this happens once] transfer = 512 Bytes * 500 / 64 M/s = 4ms [note: this transfer time implicitly includes the rotating time] total time = 10ms + 5ms + 4ms = 19ms > > > 2. SSD > > CS5600-SSD is an SSD that has 1 flash bank, 4 blocks (in the same bank), > and 8 pages (2 in each block). > CS5600-SSD uses the log-structured FTL we learn in class. > > The current state of the CS5600-SSD is as follows: > > +---------------------------------------+ > blocks | block 0 | block 1 | block 2 | block 3 | [update 11/22: was "block 2"; a typo] > +---------+---------+---------+---------+ > pages | P1 | P2 | P3 | P4 | P5 | P6 | P7 | P8 | [update 11/23: was "P5 P6"; typos] > +----+----+----+----+----+----+----+----+ > data | A | B | C | A' | | | | | > +----+----+----+----+----+----+----+----+ > > mapping: A' => P4, B => P2, C => P3 > > A, B, C are three logical pages. > Whenever they get updated, we add an apostrophe ("'") to their names, > for example, after an update to page A, A becomes A'. > In other words, (A, A', A'', A''',...) is a series of snapshots to page A. > > Questions: > > (a) draw the CS5600-SSD status (including the mapping) after running > > write(B') > write(C') > write(A'') > write(B'') > Answer: +---------------------------------------+ blocks | block 0 | block 1 | block 2 | block 3 | +---------+---------+---------+---------+ pages | P1 | P2 | P3 | P4 | P5 | P6 | P7 | P8 | +----+----+----+----+----+----+----+----+ data | A | B | C | A' | B' | C' | A''| B''| +----+----+----+----+----+----+----+----+ mapping: A'' => P7, B'' => P8, C'=> P6 [note: "mapping: A'' => P5, B'' => P6, C'=> P6" is a correct answer as well because "P7"/"P8" was "P5"/"P6", which are typos. ] > > > (b) (following the last question) now CS5600-SSD runs a round of garbage > collection which recycles all blocks that do not contain valid pages. > Draw the status after the garbage collection. > Answer: +---------------------------------------+ blocks | block 0 | block 1 | block 2 | block 3 | +---------+---------+---------+---------+ pages | P1 | P2 | P3 | P4 | P5 | P6 | P7 | P8 | +----+----+----+----+----+----+----+----+ data | | | | | B' | C' | A''| B''| +----+----+----+----+----+----+----+----+ mapping: A'' => P7, B'' => P8, C'=> P6