RFR: 8225035: Thread stack size issue caused by large TLS size
Jiangli Zhou
jianglizhou at google.com
Thu Jun 27 18:42:42 UTC 2019
Thank you Thomas and David! Glad to see that we are converging on an
acceptable approach here. I'll try to factor in all the latest inputs
from everyone and send out a new update.
Thanks and best regards,
Jiangli
On Thu, Jun 27, 2019 at 11:13 AM David Holmes <david.holmes at oracle.com> wrote:
>
> Trimming ....
>
> On 27/06/2019 12:35 pm, Jiangli Zhou wrote:
> > On Thu, Jun 27, 2019 at 9:23 AM Florian Weimer <fweimer at redhat.com> wrote:
> >> I think you can handle the guard size in this way:
> >>
> >> pthread_attr_setguardsize(&attr, guard_size);
> >>
> >> size_t stack_adjust_size = 0;
> >> if (AdjustStackSizeForTLS) {
> >> size_t minstack_size = get_minstack(&attr);
> >> size_t tls_size = minstack_size - vm_page_size() - PTHREAD_STACK_MIN;
> >> // In glibc before 2.27, tls_size still includes guard_size.
> >> // In glibc 2.27 and later, guard_size is automatically
> >> // added to the stack size by pthread_create.
> >> // In both cases, the guard size is taken into account.
> >> stack_adjust_size += tls_size;
> >> } else {
> >> stack_adjust_size += guard_size;
> >> }
> >
> > Is the vm_page_size() counted for the dl_pagesize? As long as others
> > are okay with the above suggested adjustment, it looks good to me.
> > Thomas, David and others, any objection?
>
> I find the above acceptable. I've been waiting for the dust to settle.
>
> Thanks,
> David
>
> > Thanks and best regards,
> > Jiangli
> >>
> >> Thanks,
> >> Florian
More information about the hotspot-runtime-dev
mailing list