RFR: JDK-8271242: add arena regression tests
Thomas Stuefe
stuefe at openjdk.java.net
Sat Jul 24 12:39:20 UTC 2021
On Sat, 24 Jul 2021 07:50:33 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
> Hi,
>
> May I have reviews for these new regression tests for hotspot arenas, please? Arena coding is fragile, and recently we have changed it and plan to change it some more. But we have no tests, so regression tests should exist.
>
> This is a breakout from https://github.com/openjdk/jdk/pull/4784. In which I rewrote arena alignment handling and added a lot of tests. The arena changes were rejected as too complex, which is okay, but most of the tests are still good and I hope not controversial. Therefore I would like the tests to the gtest suite.
>
> This patch adds test, but does *not* change the Arenas themselves. Instead it tests current behavior, taking it as a baseline. Where the current behavior is inconsistent (eg. when dealing with 0-sized allocations), it nevertheless tests the inconsistent behavior, since callers may rely on it.
>
> This patch also adds a new jtreg gtest wrapper which tests the arena-releated part of the tests with +UseMallocOnly. As long as we support that mode, we should test it.
>
> ---
>
> Tests:
> - manual on Linux x64 and x86 both, with and without UseMallocOnly.
> - GHAs
> - nightlies at SAP are scheduled.
>
> ----
>
> Note: this needs JDK-8270308, which is not yet pushed but under review here: https://github.com/openjdk/jdk/pull/4835.
src/hotspot/share/memory/arena.hpp line 137:
> 135: x = ARENA_ALIGN(x); // note for 32 bits this should align _hwm as well.
> 136: debug_only(if (UseMallocOnly) return malloc(x);)
> 137: // JDK-8270308: Amalloc guarantees 64-bit alignment and we need to ensure that in case the preceding
Please ignore, this belongs to JDK-8270308 which is waiting for final approval (https://github.com/openjdk/jdk/pull/4835). Will be removed before pushing.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4898
More information about the hotspot-dev
mailing list