RFR: 8275426: PretouchTask num_chunks calculation can overflow

Albert Mingkun Yang ayang at openjdk.java.net
Mon Oct 18 19:30:48 UTC 2021


On Mon, 18 Oct 2021 17:43:58 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> Please review this change to part of the calculation of the number of
> threads to apply to a PretouchTask when using a gang of worker threads.
> 
> The previous calculation of the number of chunks in the range to be touched
> can overflow in the numerator.  (This may only be a realistic problem on
> 32bit platforms.  On 64bit platforms the value constraint on the chunk size
> and plausible or architectural limits on the size of the range probably
> prevent such overflow from occurring.)
> 
> Testing:
> mach5 tier1
> Locally (linux-x64) ran with logging of the pretouch parameters enabled,
> with various chunk sizes configured, and hand-checked the logged values.

Marked as reviewed by ayang (Reviewer).

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

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



More information about the hotspot-gc-dev mailing list