***SPAM*** [PATCH] libgcc: allocate extra space for morestack expansion

Ian Lance Taylor ian@airs.com
Wed Feb 10 14:36:07 GMT 2021


Rain Mark <rain.by.zhou@gmail.com> writes:

> After enabling -fsplit-stack, dynamic stack expansion of the coroutine
> is realized, but calling functions without -fsplit-stack will directly
> expand the space by 1M, which is too wasteful for a system with a large
> number of coroutines running under the 128K stack size. We hope to give
> users more control over the size of stack expansion to adapt to
> more complex scenarios.
>
> Apply for more space each time the stack is expanded, which
> can also reduce the frequency of morestack being called.
> When calling the non-split function, we do not need additional
> checks and apply for 1M space.  At this time, we can turn off
> the conversion of linker to __morestack_non_split.  This is more friendly
> to a large number of small stack coroutines running below 128K.
>
> Later we need to add an option to the gold linker to turn off
> the __morestack_non_split conversion.

Why is the new variable thread local?

At first glance it seems like this might make more sense as a compiler
option or compiler function attribute, rather than as a function to
call.  When would you want to dynamically change the value?

Ian


More information about the Gcc-patches mailing list