released: 04/07, 9:00 due: 04/13, 23:59 > 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: 12000 RPM > note: > ** this speed number is per minute. > ** on average, it takes the disk to rotate half a circle to reach a sector. > ** So, on average, how long does CS5600-Disk rotate to a sector? > [this isn't a question you need to answer but one you should think of.] > > --Avg Seek Time, read/write: 5ms / 6 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)? (2 points) > [Write down your calculation and > write the final result in seconds with two decimal place accuracy.] > [ Answer: total time = seek + rotation + transfer for one sector: seek = 5ms [seek time is given] rotation = (60 s/1min * 1min/12000 rotations * 1000 ms/s) / 2 = 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 = (5+2.5+0.008) * 500 = 3.75s ] > > > (b) How long would it take to do 500 sector writes, spread out > randomly over the disk (and serviced in FIFO order)? (2 points) > [Write down your calculation and > write the final result in seconds with two decimal place accuracy.] > [ Answer: for one sector: seek = 6ms rotation = (60 s/1min * 1min/12000 rotations * 1000 ms/s) / 2 = 2.5ms transfer = 512 Bytes * 1s/64MB * 1MB/10^6 bytes = 8 * 10^-6 s = 0.008 ms total time = (6+2.5+0.008) * 500 = 4.25s ] > > > (c) How long would it take to do 500 sector reads, SEQUENTIALLY on the > CS5600-Disk? (FIFO order once more) (2 points) > [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 = 5ms [this happens once] rotation = 2.5ms [this happens once] transfer = 512 Bytes * 500 / 64 M/s = 4ms [note: this transfer time implicitly includes the rotating time] total time = 5ms + 2.5ms + 4ms = 11.5ms ] > > > > 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 | > +---------+---------+---------+---------+ > pages | P1 | P2 | P3 | P4 | P5 | P6 | P7 | P8 | > +----+----+----+----+----+----+----+----+ > data | D | B | C | A' | | | | | > +----+----+----+----+----+----+----+----+ > > mapping: A' => P4, B => P2, C => P3, D => P1 > > -- A, B, C, and D are four logical pages. > -- Whenever a page gets 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. > But they refer to the same logical page (from a program's point of view). > > Questions: > > (2 points) > (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 | D | B | C | A' | B' | C' | A''| B''| +----+----+----+----+----+----+----+----+ mapping: A'' => P7, B'' => P8, C'=> P6, D => P1 ] > > > (2 points) > (b) (following the last question) now CS5600-SSD runs a round of garbage > collection which recycles all blocks that do not contain valid pages. > [updated 04/10: note that this is a naive GC; it **only** "recycles all > blocks that do not contain valid pages"] > Draw the SSD 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 | D | B | | | B' | C' | A''| B''| +----+----+----+----+----+----+----+----+ mapping: A'' => P7, B'' => P8, C'=> P6, D => P1 ]