RFR: 8312132: Add tracking of multiple address spaces in NMT [v5]
Johan Sjölen
jsjolen at openjdk.org
Fri Mar 22 16:40:28 UTC 2024
On Fri, 22 Mar 2024 14:28:51 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Johan Sjölen has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Include os.inline.hpp
>
> src/hotspot/share/nmt/nmtNativeCallStackStorage.hpp line 30:
>
>> 28: #include "utilities/growableArray.hpp"
>> 29: #include "utilities/nativeCallStack.hpp"
>> 30:
>
> Here, I would love it if we had smaller than pointer-sized callstack IDs.
>
> The simplest way would be to copy callstacks into a growable area, and use their numerical indices as ID. We can get by with 16 bits, or 32 bits if we think 64K callstacks are not enough (they should be enough).
>
> Those can then be combined very efficiently with MEMFLAG and VMAState in the VMATree nodes.
>
> The hashmap for reverse id lookup could be a standard hashmap of key=callstack, value=ID.
>
> As a future possible improvement, that could then replace the MallocSiteTable which does almost the same thing. (only have to avoid using malloc then, because of recursivities).
I still don't get how a growable array is supposed to work for open addressing while having the indices staying immutable :-).
How does this work:
```c++
HTable ht; // Open-addressed GrowableArray with linear probing
Index oldidx = ht.put(4);
// A bunch of puts, leading to a resize of the array
Index newidx = ht.put(4);
assert(oldidx == newidx, "how is this ensured?");
How does this work?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18289#discussion_r1535870002
More information about the hotspot-dev
mailing list