Question: Consider the following C program: int X[N]; int step = M; /* M is some predefined constant */ for (int i = 0; i <

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.

Step by Step Solution

3.54 Rating (178 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

For these sizes a M has to be at least 4096 to ensure a TLB miss for ev... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (1 attachment)

Word file Icon

761-C-S-D-B-O-S (330).docx

120 KBs Word File

Students Have Also Explored These Related Operating System Questions!