Skip to content

fix(aspacem): raise amd64 managed address ceiling to 1 TiB#22

Merged
not-matthias merged 1 commit into
masterfrom
cod-3073-investigate-valgrind-support-for-snmallocs-256-gib
Jul 9, 2026
Merged

fix(aspacem): raise amd64 managed address ceiling to 1 TiB#22
not-matthias merged 1 commit into
masterfrom
cod-3073-investigate-valgrind-support-for-snmallocs-256-gib

Conversation

@not-matthias

Copy link
Copy Markdown
Member

Raises amd64 aspacem_maxAddr from 128 GiB to 1 TiB so a client can float a 256 GiB MAP_NORESERVE reservation (e.g. snmalloc) under Callgrind instead of getting EINVAL. Scoped to VGP_amd64_linux.

Refs COD-3073

@not-matthias not-matthias force-pushed the cod-3073-investigate-valgrind-support-for-snmallocs-256-gib branch from 7d8cb8b to 5714dad Compare July 6, 2026 12:39
@greptile-apps

greptile-apps Bot commented Jul 6, 2026

Copy link
Copy Markdown

Greptile Summary

This PR bundles two related fixes for CodSpeed's ARM64 CI environment: it raises the amd64 aspacem_maxAddr from 128 GiB to 1 TiB (scoped to VGP_amd64_linux) so that large MAP_NORESERVE allocations are no longer rejected with EINVAL, and extends the /proc/cpuinfo LL/SC-fallback detection to cover Cortex-A72.

  • aspacemgr-linux.c: 1 TiB is within the 47-bit amd64 user VA limit; the ENABLE_INNER clamp is correctly applied after the new platform guard.
  • m_machine.c: Cortex-A72 detection requires both ARM implementer (0x41) and part (0xd08) to match; false positives are safe-direction.
  • CI / bench: New llsc_tzconvert_bench.c fixture in Git LFS is compiled in CI; LFS checkout is already enabled.

Confidence Score: 5/5

Both the address-space ceiling increase and the Cortex-A72 LLSC fallback detection are targeted, well-bounded changes with no regressions for other platforms; safe to merge.

The amd64 aspacem_maxAddr increase to 1 TiB stays well inside the 47-bit user VA limit, and the ENABLE_INNER clamp is preserved. The Cortex-A72 detection adds a compound AND condition that is safe-direction on a false positive. CI additions are consistent with existing patterns and LFS is already enabled.

No files require special attention.

Important Files Changed

Filename Overview
coregrind/m_aspacemgr/aspacemgr-linux.c Raises aspacem_maxAddr from 128 GiB to 1 TiB for VGP_amd64_linux only; stays within the 47-bit user VA limit, ENABLE_INNER clamp correctly applied after the new platform guard.
coregrind/m_machine.c Extends LLSC-fallback detection to include Cortex-A72 (ARM Ltd 0x41 / part 0xd08) alongside existing Cavium check; safe-direction false positives acknowledged in comment.
.github/workflows/codspeed.yml Adds Build bench fixtures CI step compiling llsc_tzconvert_bench.c from LFS-backed source; LFS already enabled via lfs: true in checkout.
bench/generate_config.py Adds stress-ng commands and llsc_tzconvert_bench 5000 to benchmark list; follows existing testdata/... path convention.
bench/testdata/llsc_tzconvert_bench.c New Git LFS pointer for a C benchmark exercising localtime()/__tz_convert() CAS loops; compiled in CI and excluded from git tracking.
.gitignore Adds compiled llsc_tzconvert_bench binary and bench/pycache/ to .gitignore.

Reviews (2): Last reviewed commit: "fix(aspacem): raise amd64 managed addres..." | Re-trigger Greptile

@codspeed-hq

codspeed-hq Bot commented Jul 6, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 61.09%

⚡ 9 improved benchmarks
✅ 41 untouched benchmarks
🆕 10 new benchmarks
⏩ 80 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
test_valgrind[valgrind.codspeed, stress-ng --cpu 4 --cpu-ops 10, full-no-inline] 20 s 2.9 s ×6.9
test_valgrind[valgrind.codspeed, stress-ng --cpu 4 --cpu-ops 10, full-with-inline-with-cycle-estimation] 14.6 s 3.5 s ×4.2
test_valgrind[valgrind.codspeed, stress-ng --cpu 4 --cpu-ops 10, no-inline] 2.1 s 1.8 s +17.73%
test_valgrind[valgrind.codspeed, stress-ng --cpu 4 --cpu-ops 10, inline] 2.3 s 2 s +15.71%
test_valgrind[valgrind.codspeed, stress-ng --cpu 1 --cpu-ops 10, no-inline] 4.4 s 3.8 s +15.31%
test_valgrind[valgrind.codspeed, stress-ng --cpu 4 --cpu-ops 10, cycle-estimation] 2.3 s 2 s +14.74%
test_valgrind[valgrind.codspeed, stress-ng --cpu 1 --cpu-ops 10, cycle-estimation] 4.8 s 4.3 s +12.07%
test_valgrind[valgrind.codspeed, stress-ng --cpu 4 --cpu-ops 10, full-with-inline] 3.6 s 3.2 s +11.92%
test_valgrind[valgrind.codspeed, stress-ng --cpu 1 --cpu-ops 10, full-with-inline-with-cycle-estimation] 9.5 s 8.5 s +11.59%
🆕 test_valgrind[valgrind.codspeed, testdata/llsc_tzconvert_bench 5000, cycle-estimation] N/A 792.5 ms N/A
🆕 test_valgrind[valgrind.codspeed, testdata/llsc_tzconvert_bench 5000, full-no-inline] N/A 1 s N/A
🆕 test_valgrind[valgrind.codspeed, testdata/llsc_tzconvert_bench 5000, full-with-inline-with-cycle-estimation] N/A 1.3 s N/A
🆕 test_valgrind[valgrind.codspeed, testdata/llsc_tzconvert_bench 5000, full-with-inline] N/A 1.2 s N/A
🆕 test_valgrind[valgrind.codspeed, testdata/llsc_tzconvert_bench 5000, inline] N/A 910.7 ms N/A
🆕 test_valgrind[valgrind.codspeed, testdata/llsc_tzconvert_bench 5000, no-inline] N/A 705.9 ms N/A
🆕 test_valgrind[valgrind-3.25.1, testdata/llsc_tzconvert_bench 5000, full-no-inline] N/A 1 s N/A
🆕 test_valgrind[valgrind-3.25.1, testdata/llsc_tzconvert_bench 5000, full-with-inline] N/A 1.2 s N/A
🆕 test_valgrind[valgrind-3.25.1, testdata/llsc_tzconvert_bench 5000, inline] N/A 885.7 ms N/A
🆕 test_valgrind[valgrind-3.25.1, testdata/llsc_tzconvert_bench 5000, no-inline] N/A 710.8 ms N/A

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing cod-3073-investigate-valgrind-support-for-snmallocs-256-gib (5dc8a71) with master (8a82521)2

Open in CodSpeed

Footnotes

  1. 80 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on master (b738cff) during the generation of this report, so 8a82521 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@not-matthias not-matthias marked this pull request as ready for review July 6, 2026 13:11
snmalloc-rs as a global allocator aborts under Callgrind because its
startup mmap of a flat 256 GiB MAP_NORESERVE range returns EINVAL. On
amd64-linux the address-space manager capped the managed range at 128
GiB, placing vStart (the client/Valgrind split) at ~64 GiB, so the
largest floating client hole was ~62 GiB and any larger reservation was
vetoed by VG_(am_get_advisory).

Raise aspacem_maxAddr to 1 TiB (vStart ~512 GiB, ~512 GiB client hole),
scoped to VGP_amd64_linux so other 64-bit ports keep 128 GiB (some arm64
kernels expose only a 39-bit user VA). No effect on Callgrind placement
semantics; the fork ships only the 64-bit Callgrind tool.

Refs COD-3073
@not-matthias not-matthias force-pushed the cod-3073-investigate-valgrind-support-for-snmallocs-256-gib branch from 5714dad to 5dc8a71 Compare July 9, 2026 15:59
@not-matthias not-matthias changed the base branch from master to cod-3103-valgrind-atomics-have-incorrect-time-cause-hangs July 9, 2026 15:59
Base automatically changed from cod-3103-valgrind-atomics-have-incorrect-time-cause-hangs to master July 9, 2026 16:09
@not-matthias not-matthias merged commit 5dc8a71 into master Jul 9, 2026
7 of 9 checks passed
@not-matthias not-matthias deleted the cod-3073-investigate-valgrind-support-for-snmallocs-256-gib branch July 9, 2026 16:16
MrAlias pushed a commit to open-telemetry/opentelemetry-go that referenced this pull request Jul 9, 2026
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [CodSpeedHQ/action](https://redirect.github.com/CodSpeedHQ/action) |
action | patch | `v4.18.4` → `v4.18.5` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/5322) for more information.

---

### Release Notes

<details>
<summary>CodSpeedHQ/action (CodSpeedHQ/action)</summary>

###
[`v4.18.5`](https://redirect.github.com/CodSpeedHQ/action/releases/tag/v4.18.5)

[Compare
Source](https://redirect.github.com/CodSpeedHQ/action/compare/v4.18.4...v4.18.5)

#### Release Notes

##### <!-- 10 -->💼 Other

- Bump pinned valgrind-codspeed to
[3.26.0-0codspeed6](https://redirect.github.com/CodSpeedHQ/valgrind-codspeed/releases/tag/3.26.0-0codspeed6)
([#&#8203;448](https://redirect.github.com/CodSpeedHQ/action/issues/448))
by [@&#8203;adriencaccia](https://redirect.github.com/adriencaccia) in
[#&#8203;448](https://redirect.github.com/CodSpeedHQ/runner/pull/448)
- fix: hangs on ARM64 due to atomics by
[@&#8203;not-matthias](https://redirect.github.com/not-matthias) in
[CodSpeedHQ/valgrind-codspeed#23](https://redirect.github.com/CodSpeedHQ/valgrind-codspeed/pull/23)
- fix(aspacem): raise amd64 managed address ceiling to 1 TiB by
[@&#8203;not-matthias](https://redirect.github.com/not-matthias) in
[CodSpeedHQ/valgrind-codspeed#22](https://redirect.github.com/CodSpeedHQ/valgrind-codspeed/pull/22)

#### Install codspeed-runner 4.18.4

##### Install prebuilt binaries via shell script

```sh
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/CodSpeedHQ/codspeed/releases/download/v4.18.4/codspeed-runner-installer.sh | sh
```

#### Download codspeed-runner 4.18.4

| File | Platform | Checksum |
|
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ------------------- |
-------------------------------------------------------------------------------------------------------------------------------------
|
|
[codspeed-runner-aarch64-apple-darwin.tar.gz](https://redirect.github.com/CodSpeedHQ/codspeed/releases/download/v4.18.4/codspeed-runner-aarch64-apple-darwin.tar.gz)
| Apple Silicon macOS |
[checksum](https://redirect.github.com/CodSpeedHQ/codspeed/releases/download/v4.18.4/codspeed-runner-aarch64-apple-darwin.tar.gz.sha256)
|
|
[codspeed-runner-aarch64-unknown-linux-musl.tar.gz](https://redirect.github.com/CodSpeedHQ/codspeed/releases/download/v4.18.4/codspeed-runner-aarch64-unknown-linux-musl.tar.gz)
| ARM64 MUSL Linux |
[checksum](https://redirect.github.com/CodSpeedHQ/codspeed/releases/download/v4.18.4/codspeed-runner-aarch64-unknown-linux-musl.tar.gz.sha256)
|
|
[codspeed-runner-x86\_64-unknown-linux-musl.tar.gz](https://redirect.github.com/CodSpeedHQ/codspeed/releases/download/v4.18.4/codspeed-runner-x86_64-unknown-linux-musl.tar.gz)
| x64 MUSL Linux |
[checksum](https://redirect.github.com/CodSpeedHQ/codspeed/releases/download/v4.18.4/codspeed-runner-x86_64-unknown-linux-musl.tar.gz.sha256)
|

**Full Runner Changelog**:
<https://github.com/CodSpeedHQ/codspeed/blob/main/CHANGELOG.md>

**Full Changelog**:
<CodSpeedHQ/action@v4.18.4...v4.18.5>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/open-telemetry/opentelemetry-go).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNDIuMiIsInVwZGF0ZWRJblZlciI6IjQzLjI0Mi4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants