RFR: 8315362: NMT: summary diff reports threads count incorrectly [v5]
Thomas Stuefe
stuefe at openjdk.org
Tue Oct 10 16:29:13 UTC 2023
On Tue, 10 Oct 2023 13:55:05 GMT, Evgeny Ignatenko <duke at openjdk.org> wrote:
>> 8315362: NMT: summary diff reports threads count incorrectly
>
> Evgeny Ignatenko has updated the pull request incrementally with one additional commit since the last revision:
>
> Not check exact amount of added threads
There are some things I would like to see changed:
- The malloc tracker should have no knowledge of threads or thread count. Malloc has nothing to do with threads. This is a partly pre-existing issue.
- "track thread stacks as VM" - resp. its negation for AIX - was a workaround we did for AIX because AIX has no page-aligned thread stacks. I would love to get rid of that hack altogether. If not-being-page-aligned is the only issue, one simple way would be to, on AIX, align the boundaries of thread stacks up/down so that they start at whole page boundaries (in `ThreadStackTracker::new_thread_stack()`). It would be a trivial loss in fidelity, but we could get rid of this whole mechanism. @gerard-ziemski maybe? You like disentangling stuff :-)
For this patch, my proposal would be:
- make the setting of `volatile size_t ThreadStackTracker::_thread_count` in `ThreadStackTracker::(new|delete)_thread_stack()` unconditional. So, lets do this for AIX too.
- now we can always use `ThreadStackTracker::thread_count()` unconditionally when snapshoting, which removing dependence on "track_as_vm"
- Let the new `_thread_count` snapshot value, and the snapshoting itself, live in `MemBaseline`, not in the malloc snapshot. That's a better fit. Let's remove `MallocSnapshot::thread_count()` completely.
Side note, `size_t` was always an odd value for thread count. We use `unsigned` in other places since for thread counts that is enough. Would be nice to have this changed too.
Thanks!
-------------
PR Review: https://git.openjdk.org/jdk/pull/15490#pullrequestreview-1668233486
More information about the hotspot-runtime-dev
mailing list