Commit db29d41
authored
Use libunwind for jemalloc memory profiling stack traces (#5602)
## Motivation
The default libgcc DWARF unwinder (`_Unwind_Find_FDE`) used by jemalloc
for profiling
stack traces has a known livelock
([jemalloc/jemalloc#2282](jemalloc/jemalloc#2282))
— one
thread hangs in `_Unwind_Find_FDE` and all others block on futex_wait.
We've hit this in
production on validator shards.
## Proposal
Switch jemalloc's stack unwinder to libunwind by building with
`--enable-prof-libunwind`.
- Point `tikv-jemallocator` at
[linera-io/jemallocator](https://github.com/linera-io/jemallocator) fork
which adds a
`profiling_libunwind` feature (upstream doesn't support it yet —
[tikv/jemallocator#146](tikv/jemallocator#146))
- Enable `profiling_libunwind` in the `jemalloc` feature
- Add `libunwind-dev` (builder) and `libunwind8` (runtime) to
`docker/Dockerfile`
## Test Plan
- CI
- Verify memory profiling works end-to-end in a temporary network
deployment
## Release Plan
- These changes shobe backported to `testnet_conway`.
## Links
- Fork PR: linera-io/jemallocator#1
- Upstream issue:
[tikv/jemallocator#146](tikv/jemallocator#146)
- Jemalloc livelock:
[jemalloc/jemalloc#2282](jemalloc/jemalloc#2282)1 parent 82548b6 commit db29d41
9 files changed
Lines changed: 154 additions & 113 deletions
File tree
- docker
- linera-metrics
- src
- linera-service
- src
- cli
- proxy
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
156 | 155 | | |
157 | 156 | | |
158 | 157 | | |
| |||
163 | 162 | | |
164 | 163 | | |
165 | 164 | | |
| 165 | + | |
| 166 | + | |
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
| 171 | + | |
170 | 172 | | |
171 | 173 | | |
172 | 174 | | |
| |||
186 | 188 | | |
187 | 189 | | |
188 | 190 | | |
| 191 | + | |
189 | 192 | | |
190 | 193 | | |
191 | 194 | | |
| |||
267 | 270 | | |
268 | 271 | | |
269 | 272 | | |
270 | | - | |
271 | 273 | | |
272 | 274 | | |
273 | 275 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
74 | | - | |
| 75 | + | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
27 | 26 | | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
0 commit comments