RFR(xs): 8065788: os::reserve_memory() on Windows should not assert that allocation size is aligned to OS allocation granularity.
Markus Grönlund
markus.gronlund at oracle.com
Wed Dec 3 22:47:21 UTC 2014
Volker and Thomas,
I can sponsor this change.
Thanks
Markus
-----Original Message-----
From: Volker Simonis [mailto:volker.simonis at gmail.com]
Sent: den 3 december 2014 12:07
To: Thomas Stüfe
Cc: Markus Grönlund; HotSpot Open Source Developers
Subject: Re: RFR(xs): 8065788: os::reserve_memory() on Windows should not assert that allocation size is aligned to OS allocation granularity.
Hi Thomas,
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,
Volker
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.
>>
>> Cheers
>> Markus
>>
>> -----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.
>>
>> Hi,
>>
>> 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 removed.
>>
>> 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():
>>
>> http://msdn.microsoft.com/en-us/library/windows/desktop/aa366887%28v=
>> vs.85%29.aspx
>>
>>
>> Kind Regards,
>>
>> Thomas Stüfe
>>
More information about the hotspot-dev
mailing list