RFR: JDK-8257588: Make os::_page_sizes a bitmask [v6]
Thomas Stuefe
stuefe at openjdk.java.net
Wed Dec 9 18:46:38 UTC 2020
On Wed, 9 Dec 2020 18:27:30 GMT, Marcus G K Williams <github.com+168222+mgkwill at openjdk.org> wrote:
>> test/hotspot/gtest/runtime/test_os.cpp line 104:
>>
>>> 102: const size_t expected = os::page_sizes().next_smaller(s);
>>> 103: if (expected != 0) {
>>> 104: size_t actual = os::page_size_for_region_unaligned(expected - 17, 1);
>>
>> @tstuefe should **expected** here be **s** ?
>>
>> It seems like we are trying to compare the next smaller page size of S, with a slightly smaller size of the size S.
>>
>> `os::page_size_for_region_unaligned(expected - 17, 1);`
>> vs.
>> `os::page_size_for_region_unaligned(s - 17, 1);`
>>
>> Running these tests with 2 largepage sizes (3 total sizes) fails, however default of 2 page_sizes passes (4k and 2m or 1g):
>> (./hotspot/variant-server/libjvm/gtest/gtestLauncher -jdk:./images/jdk -Xms2G -Xmx2G -XX:+UseLargePages -XX:LargePageSizeInBytes=2M)
>>> [----------] 17 tests from os [ RUN ] os.page_size_for_region_vm [ OK ] os.page_size_for_region_vm (0 ms) [ RUN ] os.page_size_for_region_aligned_vm [ OK ] os.page_size_for_region_aligned_vm (0 ms)
[ RUN ] os.page_size_for_region_alignment_vm [ OK ] os.page_size_for_region_alignment_vm (0 ms) [ RUN ] os.page_size_for_region_unaligned_vm test/hotspot/gtest/runtime/test_os.cpp:106: Failure Expected equality of these values:
actual Which is: 4096 expected Which is: 2097152 [ FAILED ] os.page_size_for_region_unaligned_vm (0 ms)
>>
>> This only happen when https://github.com/openjdk/jdk/pull/1153 is present in code, because otherwise you will only have two page_sizes, but still this should return the correct results.
>
> See https://github.com/openjdk/jdk/pull/1719 for fix.
Yes, you are right, it should. I filed JDK-8257989. Feel free to fix it.
Thanks, Thomas
-------------
PR: https://git.openjdk.java.net/jdk/pull/1522
More information about the hotspot-dev
mailing list