Consider the following C program: int X[N]; int step = M; /* M is some predefined constant

Question:

Consider the following C program:
int X[N];
int step = M; /* M is some predefined constant */
for (int i = 0; i < N; i += step) X[i] = X[i] + 1;
(a) If this program is run on a machine with a 4-KB page size and 64-entry TLB, what values of M and N will cause a TLB miss for every execution of the inner loop?
(b) Would your answer in part (a) be different if the loop were repeated many times? Explain.
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Modern Operating Systems

ISBN: 978-0133591620

4th edition

Authors: Andrew S. Tanenbaum, Herbert Bos

Question Posted: