RFR: 8312132: Add tracking of multiple address spaces in NMT [v105]

Johan Sjölen jsjolen at openjdk.org
Fri May 24 09:02:39 UTC 2024


On Fri, 24 May 2024 07:48:29 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:
>> 
>>   Lower number of pages
>
> src/hotspot/share/nmt/vmatree.hpp line 146:
> 
>> 144:   struct SingleDiff {
>> 145:     int64_t reserve;
>> 146:     int64_t commit;
> 
> The typical type would be `ssize_t`, not int64. 
> 
> Apart from clarity, I am not sure how int64 would work on 32-bit.

That doesn't seem right to me. `ssize_t` has a guaranteed range of `[-1, INT_MAX)`, the -1 being there for errors. We need as full of a range of negative numbers as possible.

Good question regarding 32-bit, will have to think about that one.

Btw: Yes, I know, we can underflow or overflow the diff, but in practice no one will allocate `2**64` bytes, I am willing to take that risk.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18289#discussion_r1613124297


More information about the hotspot-dev mailing list