RFR: JDK-8281015: Further simplify NMT backend [v2]

Thomas Stuefe stuefe at openjdk.java.net
Wed Feb 23 07:22:10 UTC 2022


On Thu, 17 Feb 2022 15:49:09 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:

>> Thomas Stuefe has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains ten commits:
>> 
>>  - Zhengyus proposals
>>  - fix build error after merge (need const variant of malloc_header())
>>  - merge master
>>  - pp should handle NULL correctly
>>  - remove mostly unused MallocTracker accessors for header members
>>  - Remove use of NMT level and simplify malloc+realloc+free
>>  - dumb down malloc header
>>  - mst bucket+pos=marker
>>  - remove malloc_base
>
> Overall is good, a few minor comments.

Thanks a lot, @zhengyu123, for your review. Sorry for the delay, I had vacation. I'll implement all your proposals excluding the last one (mst_marker as structure); see comment there.

> src/hotspot/share/services/mallocTracker.hpp line 296:
> 
>> 294:   NOT_LP64(uint32_t _alt_canary);
>> 295:   const size_t _size;
>> 296:   const uint32_t _mst_marker;
> 
> make mst_marker a struct? instead of opaque type.

I played around a lot with different forms (struct, union) and in the end settled on an opaque uint32 since
- it would be passed by value and I would have to provide that structure in all kind places, I got include circularities
- I have a vague improvement in my head where we store the malloc site table entries not as individually malloced elements but in a (dynamically growing) array; that would mean we could address them by index without having to walk the bucket chains; and that index would be a simple number.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7283


More information about the hotspot-dev mailing list