Repository navigation
Commit 961b1e9
committed
mem: HG_MALLOC - hugepage slab allocator with elastic, auto-scaling arenas
Combines the v1 allocator (OpenSIPS#4126: size-class slabs over a self-made
hugepage reservation, per-process lock-free free caches, the CPU
affinity subsystem that keeps them warm) with the v2 rewrite (in-page
buddy grid, class-dedicated blocks, ownership checks on every header
read, event-driven GC, corruption counters) and extends them with v3:
arenas that grow and shrink at runtime between -m/-M INIT and a
pre-fork reserved CAP.
Growth commits whole 16 MB granules by mlock, bounded by three
independent limits (profile target, backing-tier capacity, host-RAM
floor with pkg deltas charged per worker); shrink releases whole-free
top granules back to the kernel (MADV_REMOVE returns hugetlb pages to
the pool). Policy reuses the auto_scaling_profile grammar via
shm_auto_scaling_profile / pkg_auto_scaling_profile; a latched
GROW-BLOCKED state raises E_CORE_SHM_GROW_BLOCKED; a dry-run mode
narrates decisions without acting. With no cap configured the arena is
fixed and behaviour is unchanged.
Includes modules/hgstress (multi-process stamp/verify soak driver) and
the full operator/design documentation under mem/.1 parent d5d1760 commit 961b1e9
44 files changed
Lines changed: 10721 additions & 15 deletions
File tree
- evi
- mem
- mi
- modules/hgstress
- net
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
79 | | - | |
| 80 | + | |
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| |||
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
100 | 112 | | |
101 | 113 | | |
102 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
524 | 524 | | |
525 | 525 | | |
526 | 526 | | |
| 527 | + | |
527 | 528 | | |
528 | 529 | | |
529 | 530 | | |
530 | 531 | | |
| 532 | + | |
531 | 533 | | |
532 | 534 | | |
533 | 535 | | |
| |||
558 | 560 | | |
559 | 561 | | |
560 | 562 | | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
561 | 567 | | |
562 | 568 | | |
563 | 569 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
249 | 254 | | |
250 | 255 | | |
251 | 256 | | |
| |||
290 | 295 | | |
291 | 296 | | |
292 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
293 | 302 | | |
294 | 303 | | |
295 | 304 | | |
| |||
319 | 328 | | |
320 | 329 | | |
321 | 330 | | |
| 331 | + | |
322 | 332 | | |
323 | 333 | | |
324 | 334 | | |
| |||
481 | 491 | | |
482 | 492 | | |
483 | 493 | | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
484 | 499 | | |
485 | 500 | | |
486 | 501 | | |
| |||
544 | 559 | | |
545 | 560 | | |
546 | 561 | | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
547 | 570 | | |
548 | 571 | | |
549 | 572 | | |
| |||
603 | 626 | | |
604 | 627 | | |
605 | 628 | | |
| 629 | + | |
606 | 630 | | |
607 | 631 | | |
608 | 632 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
| |||
353 | 354 | | |
354 | 355 | | |
355 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
356 | 362 | | |
357 | 363 | | |
358 | 364 | | |
| |||
407 | 413 | | |
408 | 414 | | |
409 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
410 | 420 | | |
411 | 421 | | |
412 | 422 | | |
| |||
461 | 471 | | |
462 | 472 | | |
463 | 473 | | |
| 474 | + | |
464 | 475 | | |
465 | 476 | | |
466 | 477 | | |
| |||
763 | 774 | | |
764 | 775 | | |
765 | 776 | | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
766 | 780 | | |
767 | 781 | | |
768 | 782 | | |
| |||
1259 | 1273 | | |
1260 | 1274 | | |
1261 | 1275 | | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
1262 | 1286 | | |
1263 | 1287 | | |
1264 | 1288 | | |
| |||
1644 | 1668 | | |
1645 | 1669 | | |
1646 | 1670 | | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
1647 | 1691 | | |
1648 | 1692 | | |
1649 | 1693 | | |
| |||
2797 | 2841 | | |
2798 | 2842 | | |
2799 | 2843 | | |
| 2844 | + | |
2800 | 2845 | | |
2801 | 2846 | | |
2802 | 2847 | | |
| |||
0 commit comments