Beyond malloc efficiency to fleet efficiency: a hugepage-aware memory allocator
Talkat 15th USENIX Symposium on Operating Systems Design and Implementation (OSDI '21) · 2021-07-14..07-16
summary
An enhancement of TCMALLOC called TEMERAIRE implements a huge-filler bin-packer that allocates in hugepage-sized spans, tracks per-hugepage metadata (longest free run, allocation count, pages used), and favors reducing fragmentation over best-fit to keep hugepages reclaimable. Evaluation on 8 apps shows +7.7% RPS and −2.4% RAM; a 1% fleet experiment and rollout yields ~6% fewer TLB-miss stalls, ~26% less memory wasted to fragmentation, about 1.3% fewer cycles stalled, and roughly 3–4% fleet RAM saved.
AI-written summary · about
chapters (23)
- 0:00Intro
- 0:25normally reducing malloc cycles is good
- 0:35business logic changes, infrastructure does not
- 1:05malloc cycles do not matter. $$$ spent on hardware matter.
- 1:35most cpu cycles do nothing
- 2:08hugepages cheapen the page table walk
- 2:48space efficient hugepage aware allocators are hard
- 3:07demand oscillates wildly
- 3:22emptying density - binpacking
- 3:45mistakes can live forever
- 4:14tcmalloc structure
- 4:43spans back everything
- 5:23change nothing but the page heap
- 6:08Temeraire: the design
- 6:34slack and donation
- 7:05how does the HugeFiller make decisions?
- 8:04HugeFiller tracks metadata per hugepage
- 9:55we favor fragmentation over fullness
- 11:06results
- 11:21staged rollout
- 11:52saved -1.3% of cycles
- 12:06saving memory in the process
- 12:32virtuous cycles: hugepage coverage
