CORE 0CORE 1CORE 2CORE 3L2L1L2L1L2L1L2L1L3 CACHE · SHARED BY ALL CORESC0C1C2C30510TIME →’93’97’01’04’07’10’123.6 GHzT0T1x?invalidate xx = 6x = 5
Pink blocks: the four cores; aqua: each core's private L1 (on top) and L2; slate: the shared L3Khaki boxes: copies of x; the letter beside each is its MESI state (M, E, S, I)Tokens on the bus: a request (x?), a value, or an invalidate messageTray: time to finish; red = serial part, green = parallel part split across coresFour cores on one chip, each with private L1 and L2 caches, sharing one L3 cache and a bus (not to scale). Each cached copy of x carries a MESI state; a write first invalidates the other copies, so no core reads a stale value. The tray shows Amdahl's law: the red serial part does not shrink, so 90% parallel work can never run more than 10 times faster. MESI (Modified, Exclusive, Shared, Invalid) is a write-invalidate snooping protocol, first published as the Illinois protocol by Papamarcos and Patel (ISCA 1984). Coherence is kept per cache line (64 bytes on Intel and AMD chips), not per variable. Real chips use variants such as MOESI or MESIF and often a ring or mesh with directories instead of one bus (Hennessy and Patterson, chapter 5).

Why many cores

  1. For decades each new chip ran a faster clock. Around 2004 that stopped near 3 to 4 GHz (billion ticks per second). A chip's power grows with its clock speed and with its voltage squared, so faster chips got too hot to cool.

Caches that agree

How much faster?

Numbers and code

;; step 1/11 · power-wall
;; about: Clock speed
year  chip                    clock      power
1993  Pentium                   66 MHz   10.1 W
1997  Pentium Pro              200 MHz   29.1 W
2001  Pentium 4 (Willamette)  2000 MHz   75.3 W
2004  Pentium 4 (Prescott)    3600 MHz    103 W
2007  Core 2 (Kentsfield)     2667 MHz     95 W
2010  Core i5 (Clarkdale)     3333 MHz     87 W
2012  Core i5 (Ivy Bridge)    3400 MHz     77 W

power ∝ capacitive load × voltage² × frequency

The clock stopped climbing; the power
could not go higher and still be cooled.

Dynamic power is proportional to capacitive load × voltage² × switching frequency. Intel's x86 clock rates rose for about 25 years to 3.6 GHz (Pentium 4 Prescott, 2004, 103 W) and then flattened while power fell back below 100 W (Patterson and Hennessy, Computer Organization and Design, section 1.7, The Power Wall; Sutter, The Free Lunch Is Over, 2005). Amdahl's law: speed-up = 1 / ((1 − p) + p / n) for a parallel fraction p on n cores (Amdahl, AFIPS 1967). With p = 0.9: 4 cores give 3.08×, 16 cores 6.4×, and no number of cores can exceed 1 / 0.1 = 10×.