May 28, 2024
May 28, 2024
May 28, 2024
###### Question 10746 – C-Programming
May 28, 2024

A ﬁle system uses an in-memory cache to cache disk blocks. The miss rate of the cache is shown in the ﬁgure. The latency to read a block from the cache is 1 ms and to read a block from the disk is 10 ms. Assume that the cost of checking whether a block exists in the cache is negligible. Available cache sizes are in multiples of 10 MB.

The smallest cache size required to ensure an average read latency of less than 6 ms is _______ MB.

Question 32 Explanation:
Here it is not given whether the memory is hierarchical or simultaneous.
So we consider it as hierarchical memory.
But it is given that “assume that the cost of checking whether a block exists in the cache is negligible”, which means don’t consider the checking time in the cache when there is a miss.
So formula for average access time becomes h1t1 + (1-h1)(t2) which is same as for simultaneous access.
Though the memory is hierarchical because of the statement given in the question we ignored the cache access time when there is a miss and effectively the calculation became like simultaneous access.

The average access time or read latency = h1t1 + (1-h1)t2.
It is given that the average read latency has to be less than 6ms.

So, h1t1 + (1-h1)t2 < 6
From the given information t1 = 1ms, t2 = 10ms

h1*1+(1-h1)10 < 6
10-9h1 < 6
-9h1 < – 4
-h1 < – 4/9
-h1 < -0.444
Since in the given graph we have miss rate information and 1-h1 gives the miss rate, so we add 1 on both sides of the above inequality.

1-h1 < 1-0.444
1-h1 < 0.555

So for the average read latency to be less than 6 ms the miss rate hsa to be less than 55.5%.
From the given graph the closest value of miss rate less than 55.5 is 40%.
For 40% miss rate the corresponding cache size is 30MB.

30
31
32
33