380 likes | 470 Views
COSC 3330/6308 Solutions to the Third Problem Set. Jehan-François Pâris November 2012. First problem.
E N D
COSC 3330/6308Solutions to theThird Problem Set Jehan-François PârisNovember 2012
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.
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)
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
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
Part B • Describe at the bit level how the hardware should access each of these caches?
Answer • For the direct mapping organization • TLB has 64 lines • Use 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
Answer • For the two-way associative organization • TLB has 32 lines and 2 entries per line • Use 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
Part C • How will each of the two TLBs handle collisions? (2 + 8 points for a detailed solution)
Answer • For the direct mapping organization • Entry that was not in the TLB replaces old TLB entry whose page number had samelog2 64 = 6 least significant bits
Answer • For the two-way set associative organization • Entry 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
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)
Answer • Only one percent of misses are associativity misses • Should use simpler, faster direct mapping organization
Second problem • A given make of disks has a failure rate of 5 percent per year.
Part A • What is the mean time to failure of these disks? (5 easy points)
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
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)
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
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?
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
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
More rigorous answer (II) • Probability array experiences no data loss0.999965753100 = 0.996581141 • Probability of a data loss1 – 0.996581141 = 3.42 10-3
How is that possible? • For very small values of x (1 – x)n 1 – nx
Third problem • A file server crashes on the average once every ten days.
Part A • What is the mean time between failures of this server? (5 points)
Answer • What is the mean time between failures of this server? (5 points) • One failure every ten days • MTBF is ten days
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)
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
Fourth problem • A RAID level 6 array has • Eight data blocks (b0 to b7) • Two parity blocks p and q per stripe.
Part A • How much of the total disk space is used by data blocks? (5 easy points)
Answer • How much of the total disk space is used by data blocks? (5 easy points) • 8/(8 + 2) = 0.8 or 80 percent
Part B • What is the best way to update block b5 and its two parity blocks? (10 points)
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 blockq • Computenew 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
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)
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
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)
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 isless than the Peak Floating-Point Performanceupgrading the CPU will not help
Another very good answer • If the CPU has multiple cores,check whether the program can use the multiple cores in parallel