RFR: JDK-8310107: os::trace_page_sizes_for_requested_size should name alignment as requested page size [v2]
Thomas Stuefe
stuefe at openjdk.org
Fri Jun 16 14:18:07 UTC 2023
> Somewhat trivial renaming patch.
>
> `os::trace_page_sizes_for_requested_size()` names "alignment" what is actually the requested page size. Historically, the distinction between "alignment" and "page size" in memory reservation code has not been clear. We often use "alignment" where we mean "page size". OTOH, ReservedSpace constructor takes a "preferred page size" argument, which it then uses as both alignment request and pagesize request, meaning that even if it fails to get the desired page size it attempts to satisfy the alignment.
>
> Clearing this up would be a larger effort. Here, I propose to rename "alignment" to "requested page size" in `os::trace_page_sizes_for_requested_size()` since it clearer conveys the difference between requested and actual page size, which is the important bit for pagesize logging.
>
> ---
>
> Patch renames "alignment" to "requested pagesize" in printout and code.
>
> It also reshuffles the parameters somewhat to have requested properties at the beginning, followed by the actual properties of the region.
>
> Printout before, for a failed 2M paged allocation. Notice the difference between requested and actual page size, the latter being labeled as "alignment"):
>
>
> OpenJDK 64-Bit Server VM warning: Failed to reserve and commit memory using large pages. req_addr: 0x0000000000000000 bytes: 2097152
> [0.012s][info][pagesize] Block Offset Table: req_size=2M base=0x00007f3518200000 page_size=4K alignment=2M size=2M
>
>
> Printout now:
>
>
> OpenJDK 64-Bit Server VM warning: Failed to reserve and commit memory using large pages. req_addr: 0x0000000000000000 bytes: 2097152
> [0.011s][info][pagesize] Block Offset Table: req_size=2M req_page_size=2M base=0x00007fda0e400000 size=2M page_size=4K
Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:
Feedback Stefan
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/14484/files
- new: https://git.openjdk.org/jdk/pull/14484/files/b605bec8..0c635ae1
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=14484&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=14484&range=00-01
Stats: 35 lines in 14 files changed: 6 ins; 7 del; 22 mod
Patch: https://git.openjdk.org/jdk/pull/14484.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/14484/head:pull/14484
PR: https://git.openjdk.org/jdk/pull/14484
More information about the hotspot-dev
mailing list