RFR: 8229147: Linux os::create_thread() overcounts guardpage size with newer glibc (>=2.27)

David Holmes dholmes at openjdk.org
Sat Apr 22 00:53:48 UTC 2023


On Fri, 21 Apr 2023 14:03:28 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> src/hotspot/os/linux/os_linux.cpp line 837:
>> 
>>> 835:     pthread_attr_init(&attr);
>>> 836:     size_t min_stack = _get_minstack_func(&attr);
>>> 837:     pthread_attr_setguardsize(&attr, 16*K );
>> 
>> Suggestion:
>> 
>>     pthread_attr_setguardsize(&attr, 16*K);
>
> Does this work on arches with 64K pages? Perhaps we need to check the return value of this call to make sure we were successful in setting the guard size to begin with. Otherwise we can "accidentally" discover the min_stack is not changing?

Good point. Should I use `os::vm_page_size()`?

The call cannot actually fail on Linux (none of these call can, hence no return code checking).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13571#discussion_r1174239958


More information about the hotspot-runtime-dev mailing list