RFR: 8332362: Implement os::committed_in_range for MacOS and AIX [v6]

Sonia Zaldana Calles szaldana at openjdk.org
Mon Jun 17 17:40:18 UTC 2024


On Fri, 14 Jun 2024 13:50:54 GMT, Robert Toyonaga <duke at openjdk.org> wrote:

>> ### Summary
>> This change adds `os::committed_in_range` to `src/hotspot/os/posix/os_posix.cpp` so that AIX and MacOS can use it. It is mostly the same as the prior implementation in `os_linux.cpp`, but takes into account AIX may have unaligned stacks and variable page sizes, and that mincore uses a different argument type on linux.  This will allow AIX and MacOS to report true liveness information for thread stacks reported by NMT. Previously this was only possible on Windows and Linux.
>> 
>> **Testing**
>> - `TestAlwaysPreTouchStacks.java` is updated to also test the case when stacks are large but mostly not paged in. 
>> - A few new unit tests in `test_committed_virtualmemory.cpp` to check`os::committed_in_range`. I've excluded these tests on Windows because it reports the committed region as fully paged in. 
>> - tier1
>> 
>> I've tested on Linux and Windows. I don't have a Mac to test on, but the Mac GHA tests are passing. Not yet tested on AIX.
>
> Robert Toyonaga has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add #else branch for non-AIX platforms.

Just butting in with a small comment to update all copyright headers. I saw an earlier change was merged to `TestAlwaysPreTouchStacks.java` and the copyright year didn't get updated, so this PR is an opportunity to fix that :-) 

You can try out the improved script [update_copyright_year.sh](https://github.com/openjdk/jdk/blob/master/make/scripts/update_copyright_year.sh) if it's helpful.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/19455#issuecomment-2173970631


More information about the hotspot-runtime-dev mailing list