RFR: 8303215: Make thread stacks not use huge pages [v3]
Poonam Bajaj
poonam at openjdk.org
Tue May 30 20:35:02 UTC 2023
On Mon, 29 May 2023 01:19:57 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Poonam Bajaj has updated the pull request incrementally with one additional commit since the last revision:
>>
>> addressed review comments
>
> src/hotspot/os/linux/os_linux.cpp line 934:
>
>> 932: if (stack_size >= os::Linux::default_large_page_size() && is_aligned(stack_size, os::Linux::default_large_page_size())) {
>> 933: stack_size += os::vm_page_size();
>> 934: }
>
> Do we need to watch for a zero default size here so that we don't expand all stacks by a page?
Added a check for zero default page size. Please review.
> src/hotspot/os/linux/os_linux.cpp line 3754:
>
>> 3752:
>> 3753: void os::large_page_init() {
>> 3754: // Scan default large page size
>
> Suggestion:
>
> // Always initialize the default large page size even if large pages are not being used.
Changed the comment.
> src/hotspot/os_cpu/linux_aarch64/globals_linux_aarch64.hpp line 34:
>
>> 32: define_pd_global(bool, DontYieldALot, false);
>> 33:
>> 34: // set default stack sizes < 2MB so as to prevent stacks from getting
>
> /set/Set/
Done.
> src/hotspot/os_cpu/linux_aarch64/globals_linux_aarch64.hpp line 36:
>
>> 34: // set default stack sizes < 2MB so as to prevent stacks from getting
>> 35: // large-page aligned and backed by THPs on systems where 2MB is the
>> 36: // default huge page size. For non-JavaThreads, glibc adds an additional
>
> s/adds/may add/
Done.
> src/hotspot/os_cpu/linux_aarch64/globals_linux_aarch64.hpp line 38:
>
>> 36: // default huge page size. For non-JavaThreads, glibc adds an additional
>> 37: // guard page to the total stack size, so to keep the default sizes same
>> 38: // for all the following flags, we set them to 2 pages less than 2MB.
>
> I still think we need to at least mention we assume 4K page here.
@dholmes-ora I have updated the comment, please review.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14105#discussion_r1210794132
PR Review Comment: https://git.openjdk.org/jdk/pull/14105#discussion_r1210794392
PR Review Comment: https://git.openjdk.org/jdk/pull/14105#discussion_r1210794644
PR Review Comment: https://git.openjdk.org/jdk/pull/14105#discussion_r1210794720
PR Review Comment: https://git.openjdk.org/jdk/pull/14105#discussion_r1210793561
More information about the hotspot-runtime-dev
mailing list