RFR(xs): 8065788: os::reserve_memory() on Windows should not assert that allocation size is aligned to OS allocation granularity.
volker.simonis at gmail.com
Wed Dec 3 11:06:53 UTC 2014
I think your change is good although I'd prefer if you would assert
that the allocation size is aligned to page size (as you've already
proposed in your first mail). Callers of os::pd_reserve_memory() can
then be cleaned up to only "align_size_up" up to page size because
that's what gets reserved by the OS anyway.
Thank you and best regards,
PS: I'm only a reviewer but not a sponsor so any volunteers are still welcome:)
On Wed, Nov 26, 2014 at 12:50 PM, Thomas Stüfe <thomas.stuefe at gmail.com> wrote:
> Thank you Markus!
> Could I have another Reviewer, and maybe someone who sponsors the change?
> Please note that this bug is not purely theoretical, but prevents us from
> reserving just one page on windows, which then leads to everyone aligning
> the reserve size up to vm_allocation_granularity() just to make the assert
> go away. Actually, I see a lot of "align_size_up()"s with
> vm_allocation_granularity() which may be unnecessary and could probably get
> cleaned up.
> Kind Regards, Thomas
> On Tue, Nov 25, 2014 at 11:21 AM, Markus Grönlund <
> markus.gronlund at oracle.com> wrote:
>> Hi Thomas,
>> Thanks for finding and addressing this - looks good.
>> -----Original Message-----
>> From: Thomas Stüfe [mailto:thomas.stuefe at gmail.com]
>> Sent: den 24 november 2014 18:32
>> To: HotSpot Open Source Developers
>> Subject: RFR(xs): 8065788: os::reserve_memory() on Windows should not
>> assert that allocation size is aligned to OS allocation granularity.
>> a very small change:
>> Bug Report: https://bugs.openjdk.java.net/browse/JDK-8065788
>> WebRev: http://cr.openjdk.java.net/~simonis/webrevs/8065788/
>> os::reserve_memory() on Windows asserts that allocation size is allocated
>> to os::vm_allocation_granularity(). This assert is wrong and should be
>> Allocation granularity affects the alignment of attach addresses, not of
>> the allocated size. The latter is aligned to page size, but asserting that
>> would be unnecessarily strict, as VirtualAlloc() will just quietly align
>> size up to page size.
>> For details see MSDN on VirtualAlloc():
>> Kind Regards,
>> Thomas Stüfe
More information about the hotspot-dev