Skip to content

drepper 2007

Record metadata
cite: U. Drepper, What Every Programmer Should Know About Memory, Red Hat, Inc., version 1.0, 21 November 2007.
url: https://people.freebsd.org/~lstewart/articles/cpumemory.pdf
status: read
anchors: setup#1

Not cited by the article. Read for lines/contention-and-the-shared-file.md on 28 November 2026 (claude-code), in the PDF at the address above; pages as printed.

  • p. 26, §3.3.4: the MESI protocol, "named after the four states a cache line can be in" (Modified, Exclusive, Shared, Invalid). A write by a second processor to a Modified line is "the infamous 'Request For Ownership' (RFO) operation".
  • p. 27: "Whenever such a message has to be sent things are going to be slow"; "Programs need to be carefully designed to minimize accesses from different processors and cores to the same memory locations."
  • pp. 65–66, §6.4.1: the false-sharing test (threads each incrementing their own location 500 million times, four P4 processors); on separate lines it "scales without penalty"; on one line the overhead is "390%, 734%, and 1,147%"; "All processors, except the one which has the cache line at any given moment, are delayed and cannot do anything."
  • p. 66: the remedy begins by identifying "which variables are used by only one thread at a time, those used by only one thread ever, and maybe those which are contested at times", with the separate criterion "are they ever written to and how often". (Corrected by a reading of 28 November 2026: an earlier note merged the two lists.)
  • p. 66, Fig. 6.11: on a single quad-core processor (Core 2 QX 6700) the same test "does not show any scalability issues"; the overhead "does not increase with the number of cores".
  • p. 67: the numbered advice: separate read-only from read-write variables (read-mostly as a possible third category); group read-write variables used together into a structure; move those "often written to by different threads onto their own cache line", which "might mean adding padding".

Not checked: the published LWN serialisation of 2007, whose section numbering may differ.