![Page 1: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/1.jpg)
COSC 3330/6308Solutions to theThird Problem Set
Jehan-François PârisNovember 2012
![Page 2: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/2.jpg)
First problem
You are to design a TLB for a virtual memory system with 64-bit addresses and 4-kilobyte pages. It should have with 64 entries with each entry mapping one virtual page into one physical page. You are to consider two possible TLB organizations, namely
One using direct mapping Another using two-way set associativity.
![Page 3: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/3.jpg)
Part A
What would be the minimum sizes in bits of the entry tags for each of these two cache organizations? (2×5 easy points)
![Page 4: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/4.jpg)
Answer
For the direct mapping organization Entry tag is page number Page number is 64 – log2 4096 = 52 bits
Last log2 64 = 6 bits of tag are given by the
entry index Minimum size of tag is 52 – 6 = 46 bits
![Page 5: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/5.jpg)
Answer
For the two-way set associative organization Entry tag is page number TLB has 32 lines each with two entries Page number is still 52 bits Last log2 32 = 5 bits of tag are given by the
entry index Minimum size of tag is 52 – 5 = 47 bits
![Page 6: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/6.jpg)
Part B
Describe at the bit level how the hardware should access each of these caches?
![Page 7: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/7.jpg)
Answer
For the direct mapping organizationTLB has 64 linesUse log2 64 = 6 least significant bits of page
number as index If page number matches the tag :
Get page frame number and bits
else : Declare a TLB miss
![Page 8: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/8.jpg)
Answer
For the two-way associative organizationTLB has 32 lines and 2 entries per lineUse log2 32 = 5 least significant bits of page number
as index If page number matches tag of one of the two entries :
Get page frame number and bits
else : Declare a TLB miss
![Page 9: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/9.jpg)
Part C
How will each of the two TLBs handle collisions? (2 + 8 points for a detailed solution)
![Page 10: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/10.jpg)
Answer
For the direct mapping organizationEntry that was not in the TLB replaces old
TLB entry whose page number had samelog2 64 = 6 least significant bits
![Page 11: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/11.jpg)
Answer
For the two-way set associative organizationEntry that was not in the TLB will replace one on
the two old TLB entries whose page number had same log2 32 = 5 least significant bits
Should select Least Recently Used entry Will add to cache an extra bit set to
Zero when first entry of line is accessed One when second entry is accessed
![Page 12: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/12.jpg)
Part D
Measurements on the direct mapping cache indicate that 80 percent of the misses are compulsory
misses 19 percent of them are capacity misses Remaining misses are all associativity
misses.
What conclusions can you draw? (5 points)
![Page 13: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/13.jpg)
Answer
Only one percent of misses are associativity misses
Should use simpler, faster direct mapping organization
![Page 14: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/14.jpg)
Second problem
A given make of disks has a failure rate of 5 percent per year.
![Page 15: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/15.jpg)
Part A
What is the mean time to failure of these disks? (5 easy points)
![Page 16: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/16.jpg)
Answer
What is the mean time to failure of these disks? (5 easy points) Failure rate is 5 percent per year One failure every 20 years MTTF is 20 years
![Page 17: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/17.jpg)
Part B
Assuming that all data are mirrored on two disks, and that it takes twelve hours to replace a failed disk and restore its contents, what is the probability that a single disk failure will lead to a data loss? (5 points)
![Page 18: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/18.jpg)
Answer
Assuming that all data are mirrored on two disks, and that it takes twelve hours to replace a failed disk and restore its contents, what is the probability that a single disk failure will lead to a data loss? (5 points) Probability of second failure while first disk
gets repaired is ½ 1/365 0.05 = 6.85 10-5
![Page 19: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/19.jpg)
Part C
Consider a disk farm consisting of 100 pairs of mirrored disks for a total of 200 disks.
What would be the probability of a data loss over a period of five years?
![Page 20: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/20.jpg)
Simplest Answer
Probability a given disk fails during the five years5 0.05 = 0.25
Probability a given disk fails and it leads to a data loss0.25 6.85 10-5 = 1.71 10-5
Probability any of the 200 disk fails and it leads to a data loss1.71 10-5 200 = 3.42 10-3
![Page 21: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/21.jpg)
More rigorous answer (I)
Probability a given disk fails during the five years5 0.05 = 0.25
Probability a given disk fails and it leads to a data loss0.25 6.85 10-5 = 1.71 10-5
Probability a pair experiences a data loss2 1.71 10-5 = 3.42 10-5
Probability a pair experiences no data loss1 - 3.42 10-5 = 0.999965753
![Page 22: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/22.jpg)
More rigorous answer (II)
Probability array experiences no data loss0.999965753100 = 0.996581141
Probability of a data loss1 – 0.996581141 = 3.42 10-3
![Page 23: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/23.jpg)
How is that possible?
For very small values of x
(1 – x)n 1 – nx
![Page 24: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/24.jpg)
Third problem
A file server crashes on the average once every ten days.
![Page 25: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/25.jpg)
Part A
What is the mean time between failures of this server? (5 points)
![Page 26: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/26.jpg)
Answer
What is the mean time between failures of this server? (5 points) One failure every ten days MTBF is ten days
![Page 27: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/27.jpg)
Part B
What is the maximum mean time to repair that we can tolerate if we want to achieve an average availability of 99.5 percent? (5 points)
![Page 28: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/28.jpg)
Answer
What is the maximum mean time to repair that we can tolerate if we want to achieve an average availability of 99.5 percent? (5 points) We have
MTTF + MTTR = 10 days MTTF/(MTTF + MTTR) = 0.995
MTTF/10 = 0.995MTTF = 0.95 daysMTTR = 0.05 days = 1.2 hours
![Page 29: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/29.jpg)
Fourth problem
A RAID level 6 array has Eight data blocks (b0 to b7)
Two parity blocks p and q
per stripe.
![Page 30: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/30.jpg)
Part A
How much of the total disk space is used by data blocks? (5 easy points)
![Page 31: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/31.jpg)
Answer
How much of the total disk space is used by data blocks? (5 easy points)
8/(8 + 2) = 0.8 or 80 percent
![Page 32: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/32.jpg)
Part B
What is the best way to update block b5 and its two parity blocks? (10 points)
![Page 33: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/33.jpg)
Answer
What is the best way to update block b5 and its two
parity blocks? (10 points) Read old block b5, old parity block p and
old parity block q Compute
new p = old p old b5 new d
new q = old q old b5 new d
Write new b5, new p and new q
Give full credit to people who do not have the formulas
![Page 34: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/34.jpg)
Fifth problem
A task is distributed along 128 processors but the maximum observed speedup is only 50.
People suspect that this low figure is due to a single processor.
What is the share of the workload that is executed by that processor? (5 points)
![Page 35: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/35.jpg)
Answer
A task is distributed along 128 processors but the maximum observed speedup is only 50.
People suspect that this low figure is due to a single processor.
What is the share of the workload that is executed by that processor? (5 points)
1/50 of the workload
![Page 36: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/36.jpg)
Sixth problem
People in your research group are unhappy with the speed of the computer they use to run a huge program.
Somebody suggests upgrading the CPU of the computer.
What do we need to know before deciding to do so? (5 points)
![Page 37: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/37.jpg)
Answer
The question is whether it would be really help Must know the
Peak Memory BW Arithmetic Intensity
of program If Peak Memory BWArithmetic Intensity is
less than the Peak Floating-Point Performanceupgrading the CPU will not help
![Page 38: COSC 3330/6308 Solutions to the Third Problem Set Jehan-François Pâris November 2012](https://reader035.vdocument.in/reader035/viewer/2022062713/56649f555503460f94c78f9c/html5/thumbnails/38.jpg)
Another very good answer
If the CPU has multiple cores,check whether the program can use the multiple cores in parallel