CDS, replace ArchiveRelocationMode?
Ioi Lam
ioi.lam at oracle.com
Tue Nov 2 15:54:02 UTC 2021
I wonder how this will impact the tests. ArchiveRelocationMode is very
easy to use in the tests. For "scattershot_into_range(address, len)", I
image it will require the knowledge of where to do the "inconvenient
reservation". Will that need to be handled by the test cases, or by some
code inside the VM?
Also, currently in debug builds, ArchiveRelocationMode makes it possible
to map every region of the archive, and then pretend something fails at
the end. This will trigger the clean up of all the mapped regions
(including the very last mapped region. This may not be possible with
"scattershot_into_range(address, len)".
Plus, ArchiveRelocationMode can be used in product build (albeit a
diagnostic option) to force relocation. So it can be used by people who
prefer to always ASLR the CDS archive. It would be unnatural if this
needs to be accomplished with an "inconvenient reservation".
Thanks
- Ioi
On 11/2/21 8:36 AM, Thomas Stüfe wrote:
> Hi,
>
> A small idea. I wonder whether we could reduce the complexity of CDS
> reservation a bit and at the same time make testing more realistic by
> replacing ArchiveRelocationMode with a test switch that, prior to any
> initialization, populates the address space with "inconvenient"
> reservations. Either targeted to some predefined areas or scattershot for
> random tests.
>
> A function like "scattershot_into_range(address, len)" could be called even
> between reserving the whole range and mapping the individual ranges, to
> mimic reservation failures where "oops someone was faster than you".
>
> Such a feature could be reused in a number of places, and we could remove
> the ArchiveRelocationMode switch and its handling. What do you think?
>
> Cheers, Thomas
More information about the hotspot-runtime-dev
mailing list