Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase per thread stack size #724

Open
wants to merge 1 commit into
base: bfgminer
Choose a base branch
from

Conversation

TheBiggerGuy
Copy link

When using musl libc the default statck size is too small for the scrypt
code that uses alloca.

see: #723

When using musl libc the default statck size is too small for the scrypt
code that uses alloca.

see: luke-jr#723
@luke-jr
Copy link
Owner

luke-jr commented Oct 21, 2017

Hmm, IIRC there is already stacksize stuff in BFGMiner. Do we want all these threads to have that stack size? Might it be a reduction in normal use cases, breaking other drivers?

@TheBiggerGuy
Copy link
Author

So first I should of made it clear with is a Work In Progress and should not be committed yet. The known issues with it are to do with page size alignment that I am still looking into.

To you questions:

  • "already stacksize stuff in BFGMiner": Didn't see any/can't find any, do you know where it is?
  • "Do we want all these threads to have that stack size": This is only applied to the driver threads that do the scrypt hash and actually sets it to the GLibc default so is not worse than when not using musl libc.
  • "Might it be a reduction in normal use cases, breaking other drivers": The 2 << 20 number is the GLibc default so I used that. To my page size alignment reference above the libav bug is better coded to read the current size and only bump it if required. I'm looking into that as a better patch.

For context I found this issues when moving to Alpine Linux to minimise a Docker container. This config is only compiled with scrypt, a single gridseed driver and on ARM.

@luke-jr
Copy link
Owner

luke-jr commented Oct 21, 2017

Looks like in the past we've just avoided using stack space too much.

Some #define magic may be needed for Windows: https://github.com/GerHobbelt/pthread-win32/blob/master/pthread_attr_setstacksize.c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants