[jdk11u-dev] RFR: 8257588: Make os::_page_sizes a bitmask
Daishi Tabata
dtabata at openjdk.org
Fri Feb 20 05:25:00 UTC 2026
JDK-8257588 is an enhancement aims to improve the internal handling of page sizes within the HotSpot JVM.
The fix was originally implemented in JDK 16. We are now backporting it to JDK 11.
### Unclean Backport
- The backport was not entirely clean due to the introduction of utility functions related to power-of-two calculations. Specifically, the `powerOfTwo.hpp` header, which centralizes these utilities in later JDK versions (introduced by JDK-8234331), was not present in JDK 11.
- A full backport of `powerOfTwo.hpp` would bring in a lot of code unnecessary for JDK-8257588, so it should not be imported as-is.
- Instead of a full backport of `powerOfTwo.hpp`, a highly targeted integration was performed. Only the precise `powerOfTwo` utility functions essential for JDK-8257588's operation (e.g., `max_power_of_2_size_t`, `log2_size_t`, `round_down_power_of_2_size_t`) were selectively extracted and adapted. These minimal, required functions were then strategically placed within the existing `src/hotspot/share/utilities/globalDefinitions.hpp` file in the JDK 11 backport.
### Testing
**System:** Red Hat Enterprise Linux 9.4 (x86_64).
**gtest**: All 25 tests in the `gtest:os/server` suite, including those directly related to `os::PageSizes`, passed successfully.
**jtreg**: All 672 tests in the `hotspot_runtime` group and all 12 tests in the `vmTestbase_largepages` group passed successfully.
-------------
Commit messages:
- initial commit
Changes: https://git.openjdk.org/jdk11u-dev/pull/3160/files
Webrev: https://webrevs.openjdk.org/?repo=jdk11u-dev&pr=3160&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8257588
Stats: 240 lines in 8 files changed: 188 ins; 29 del; 23 mod
Patch: https://git.openjdk.org/jdk11u-dev/pull/3160.diff
Fetch: git fetch https://git.openjdk.org/jdk11u-dev.git pull/3160/head:pull/3160
PR: https://git.openjdk.org/jdk11u-dev/pull/3160
More information about the jdk-updates-dev
mailing list