Twelve Thousand Bytes Four Pages
Pages are 4 KiB. A 3000-element int array is 4-byte aligned but not page aligned: it begins at virtual address 0x5A3C (decimal 23,100).
int a[3000]; /* starts at 0x5A3C, 12000 bytes */
long s = 0;
for (int i = 0; i < 3000; i++)
s += a[i];
The TLB is fully associative with 64 entries and starts empty. Ignore the instruction fetches and the loop variables. How many TLB misses do the array loads take?
Sign in to answer questions and track your progress
Sign In