RFR: 8225035: Thread stack size issue caused by large TLS size

Jiangli Zhou jianglizhou at google.com
Tue Jun 18 20:57:53 UTC 2019


Hi Florian,

On Tue, Jun 18, 2019 at 12:14 AM Florian Weimer <fweimer at redhat.com> wrote:

> * Jiangli Zhou:
>
> > Hi Andrew and Florian,
> >
> > With the stack size needs to be aligned at page boundary, it seems that
> the effect of using
> > large page size is the same for the following two approaches:
> >
> > 1 Using a JVM knob which specifies a minimum stack size for stack size
> adjustment
> >  (suggested by Florian)
> > 2 Using the value obtained from __pthread_get_minstack for stack size
> adjustment
>
> Approach 2 does not work if code needs more stack space than initially
> planned for other reasons besides increased static TLS use by the
> process.  For example, a newer CPU might require storing additional data
> on the stack during some operations (such as signal delivery).
>
> Approach 1 would work in these cases as well, so I expect that you will
> need it eventually.
>

Thanks for additional thoughts!

Would it be do-able to implement cpu-specific code within the JVM to handle
those cases when needed (?). Thinking from the developers perspective,
offloading the burden of tuning the size might be the best when it's
achievable. In the particular TLS case, it does add burdens to the
development and production process if we go with approach 1 (user specified
minimum stack size), because different size settings need to be used with
and without the extra TLS space. Sounds reasonable?

Best regards,
Jiangli



> Thanks,
> Florian
>


More information about the hotspot-runtime-dev mailing list