Sixty Four Is Too Big

The CS:APP blocked matrix multiply keeps a bsize by bsize block of B resident while the i loop sweeps n row slivers of A and C past it:

for (kk = 0; kk < en; kk += bsize)
  for (jj = 0; jj < en; jj += bsize)
    for (i = 0; i < n; i++)
      for (j = jj; j < jj + bsize; j++) {
        sum = C[i][j];
        for (k = kk; k < kk + bsize; k++)
          sum += A[i][k] * B[k][j];
        C[i][j] = sum;
      }

Elements are doubles and L1d is 32 KB. An engineer reasons "a bigger block means more reuse" and sets bsize = 64. What actually happens?

A

bsize must divide n exactly, so a bsize of 64 silently skips the trailing columns.

B

The block of B alone is 642×8=3276864^2 \times 8 = 32768 bytes, the entire L1d, so the A and C slivers evict parts of it and the reuse the blocking was written to buy disappears.

C

Nothing changes, since a larger block always increases temporal locality.

D

The block stops fitting in one 4 KB page, so TLB misses replace the cache misses.