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

David Holmes dholmes at openjdk.org
Wed Apr 26 01:44:22 UTC 2023


On Sun, 23 Apr 2023 01:42:39 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> pthread_attr_setguardsize takes the value and stores it in the attribute as-is, since [POSIX](https://pubs.opengroup.org/onlinepubs/009604599/functions/pthread_attr_getguardsize.html) requires:
>> 
>> "If an implementation rounds up the value of guardsize to a multiple of {PAGESIZE}, a call to pthread_attr_getguardsize() specifying attr shall store in the guardsize parameter the guard size specified by the previous pthread_attr_setguardsize() function call."
>> 
>> pthread_create, when creating the thread, will round up the size to the nearest page size.
>
> @tstuefe  that is all true and correct, but what we don't know (without looking at the implementation) is what `__get_minstack` will do with the value in the attribute. I guess I need to find the old version of the code and see whether it does a raw read or adjusts it somehow based on pagesize.

The value is used as-is so its actual value does not matter.

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

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


More information about the hotspot-runtime-dev mailing list