RFR(xs): 8065788: os::reserve_memory() on Windows should not assert that allocation size is aligned to OS allocation granularity.
thomas.stuefe at gmail.com
Wed Dec 3 16:18:46 UTC 2014
Hi Volker, thanks for looking into this!
According to your proposal I changed the code to assert for pagesize.
This also should not cause any issues, because before we enforced alignment
to allocation granularity, which is a multiple of the page size.
Still looking for a sponsor :)
Kind Regards, Thomas
On Wed, Dec 3, 2014 at 12:06 PM, Volker Simonis <volker.simonis at gmail.com>
> 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,
> PS: I'm only a reviewer but not a sponsor so any volunteers are still
> On Wed, Nov 26, 2014 at 12:50 PM, Thomas Stüfe <thomas.stuefe at gmail.com>
> > 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
> > go away. Actually, I see a lot of "align_size_up()"s with
> > vm_allocation_granularity() which may be unnecessary and could probably
> > 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
> >> 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
> >> 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