Repository navigation
Commit dae0ae8
committed
hg_malloc: report max_used as the peak of real_used, not the peak carve
max_used was the high-water mark of hb->real_used, which in the slab
path is the CARVE total. Carve only ever grows - each worker carves its
own chunk the first time it touches a size class - so max_used climbed
indefinitely and drifted away from real_used instead of meaning what it
means for every other allocator: the peak that real_used reached.
Track the peak of the reported live figure separately and report that.
The mark is sampled when the stats are read, so a spike between two
reads can be missed, and the unsynchronized update is a benign race - a
lost update can only under-report. The peak carve is still kept in
max_real_used; exposing it belongs in a stat of its own, not in
max_used.1 parent 522c01c commit dae0ae8
2 files changed
Lines changed: 24 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
471 | 472 | | |
472 | 473 | | |
473 | 474 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
232 | 242 | | |
233 | 243 | | |
234 | 244 | | |
| |||
435 | 445 | | |
436 | 446 | | |
437 | 447 | | |
| 448 | + | |
| 449 | + | |
438 | 450 | | |
439 | | - | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
440 | 454 | | |
441 | 455 | | |
442 | 456 | | |
443 | | - | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
444 | 460 | | |
445 | 461 | | |
446 | 462 | | |
| |||
0 commit comments